OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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 UI_VIEWS_CONTROLS_BUTTON_MULTI_TARGET_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_MULTI_TARGET_BUTTON_H_ |
| 7 |
| 8 #include "ui/views/controls/button/button.h" |
| 9 #include "ui/views/controls/button/button_dropdown.h" |
| 10 #include "ui/views/controls/button/menu_button_listener.h" |
| 11 #include "ui/views/view.h" |
| 12 |
| 13 namespace ui { |
| 14 class MenuModel; |
| 15 } |
| 16 |
| 17 namespace views { |
| 18 |
| 19 class LabelButton; |
| 20 class MenuButton; |
| 21 class MenuDelegate; |
| 22 class MenuRunner; |
| 23 |
| 24 // A button with a drop down menu to select other options. |
| 25 class VIEWS_EXPORT MultiTargetButton : public views::View, |
| 26 public views::ButtonListener, |
| 27 public views::MenuButtonListener { |
| 28 public: |
| 29 explicit MultiTargetButton(ui::MenuModel* menu_model); |
| 30 |
| 31 virtual ~MultiTargetButton(); |
| 32 |
| 33 // views::ButtonListener: |
| 34 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; |
| 35 |
| 36 // views::MenuButtonListener: |
| 37 virtual void OnMenuButtonClicked(View* source, const gfx::Point& point) |
| 38 OVERRIDE; |
| 39 |
| 40 private: |
| 41 ui::MenuModel* menu_model_; |
| 42 LabelButton* button_; |
| 43 MenuButton* drop_arrow_button_; |
| 44 |
| 45 scoped_ptr<MenuRunner> menu_runner_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(MultiTargetButton); |
| 48 }; |
| 49 |
| 50 } // namespace views |
| 51 |
| 52 #endif // UI_VIEWS_CONTROLS_BUTTON_MULTI_TARGET_BUTTON_H_ |
OLD | NEW |