| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ |
| 6 #define VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ | 6 #define VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "views/controls/button/image_button.h" | 10 #include "views/controls/button/image_button.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 class MenuModel; | 13 class MenuModel; |
| 14 } // namespace ui | 14 } // namespace ui |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 | 17 |
| 18 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
| 19 // | 19 // |
| 20 // ButtonDropDown | 20 // ButtonDropDown |
| 21 // | 21 // |
| 22 // A button class that when pressed (and held) or pressed (and drag down) will | 22 // A button class that when pressed (and held) or pressed (and drag down) will |
| 23 // display a menu | 23 // display a menu |
| 24 // | 24 // |
| 25 //////////////////////////////////////////////////////////////////////////////// | 25 //////////////////////////////////////////////////////////////////////////////// |
| 26 class VIEWS_API ButtonDropDown : public ImageButton { | 26 class VIEWS_EXPORT ButtonDropDown : public ImageButton { |
| 27 public: | 27 public: |
| 28 // The button's class name. | 28 // The button's class name. |
| 29 static const char kViewClassName[]; | 29 static const char kViewClassName[]; |
| 30 | 30 |
| 31 ButtonDropDown(ButtonListener* listener, ui::MenuModel* model); | 31 ButtonDropDown(ButtonListener* listener, ui::MenuModel* model); |
| 32 virtual ~ButtonDropDown(); | 32 virtual ~ButtonDropDown(); |
| 33 | 33 |
| 34 // Overridden from views::View | 34 // Overridden from views::View |
| 35 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; | 35 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; |
| 36 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; | 36 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 64 | 64 |
| 65 // A factory for tasks that show the dropdown context menu for the button. | 65 // A factory for tasks that show the dropdown context menu for the button. |
| 66 ScopedRunnableMethodFactory<ButtonDropDown> show_menu_factory_; | 66 ScopedRunnableMethodFactory<ButtonDropDown> show_menu_factory_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(ButtonDropDown); | 68 DISALLOW_COPY_AND_ASSIGN(ButtonDropDown); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace views | 71 } // namespace views |
| 72 | 72 |
| 73 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ | 73 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ |
| OLD | NEW |