Home | History | Annotate | Download | only in views
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_
      6 #define CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_
      7 #pragma once
      8 
      9 #include <string>
     10 
     11 #include "views/controls/button/menu_button.h"
     12 
     13 namespace chromeos {
     14 
     15 // MenuButton specification that uses different icons to draw the button and
     16 // adjust focus frame accordingly to the icons particularities.
     17 class DropDownButton : public views::MenuButton {
     18  public:
     19   DropDownButton(views::ButtonListener* listener,
     20                  const std::wstring& text,
     21                  views::ViewMenuDelegate* menu_delegate,
     22                  bool show_menu_marker);
     23   virtual ~DropDownButton();
     24 
     25   virtual void OnPaintFocusBorder(gfx::Canvas* canvas);
     26 
     27   // Override SetText to set the accessible value, rather than the
     28   // accessible name, since this acts more like a combo box than a
     29   // menu.
     30   virtual void SetText(const std::wstring& text);
     31 
     32   virtual string16 GetAccessibleValue() { return text_; }
     33 
     34  private:
     35   DISALLOW_COPY_AND_ASSIGN(DropDownButton);
     36 };
     37 
     38 }  // namespace chromeos
     39 
     40 #endif  // CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_
     41