| 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 UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ |
| 6 #define UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ | 6 #define UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "ui/ui_api.h" | 12 #include "ui/base/ui_export.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 // A model representing the rows of buttons that should be inserted in a button | 16 // A model representing the rows of buttons that should be inserted in a button |
| 17 // containing menu item. | 17 // containing menu item. |
| 18 class UI_API ButtonMenuItemModel { | 18 class UI_EXPORT ButtonMenuItemModel { |
| 19 public: | 19 public: |
| 20 // Types of buttons. | 20 // Types of buttons. |
| 21 enum ButtonType { | 21 enum ButtonType { |
| 22 TYPE_SPACE, | 22 TYPE_SPACE, |
| 23 TYPE_BUTTON, | 23 TYPE_BUTTON, |
| 24 TYPE_BUTTON_LABEL | 24 TYPE_BUTTON_LABEL |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 class UI_API Delegate { | 27 class UI_EXPORT Delegate { |
| 28 public: | 28 public: |
| 29 // Some command ids have labels that change over time. | 29 // Some command ids have labels that change over time. |
| 30 virtual bool IsItemForCommandIdDynamic(int command_id) const; | 30 virtual bool IsItemForCommandIdDynamic(int command_id) const; |
| 31 virtual string16 GetLabelForCommandId(int command_id) const; | 31 virtual string16 GetLabelForCommandId(int command_id) const; |
| 32 | 32 |
| 33 // Performs the action associated with the specified command id. | 33 // Performs the action associated with the specified command id. |
| 34 virtual void ExecuteCommand(int command_id) = 0; | 34 virtual void ExecuteCommand(int command_id) = 0; |
| 35 virtual bool IsCommandIdEnabled(int command_id) const; | 35 virtual bool IsCommandIdEnabled(int command_id) const; |
| 36 virtual bool DoesCommandIdDismissMenu(int command_id) const; | 36 virtual bool DoesCommandIdDismissMenu(int command_id) const; |
| 37 | 37 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 std::vector<Item> items_; | 105 std::vector<Item> items_; |
| 106 | 106 |
| 107 Delegate* delegate_; | 107 Delegate* delegate_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel); | 109 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace ui | 112 } // namespace ui |
| 113 | 113 |
| 114 #endif // UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ | 114 #endif // UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ |
| OLD | NEW |