Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // Shows the menu with the given |menu_model|. | 37 // Shows the menu with the given |menu_model|. |
| 38 virtual void ShowMenu(scoped_ptr<ActionBoxMenuModel> menu_model); | 38 virtual void ShowMenu(scoped_ptr<ActionBoxMenuModel> menu_model); |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 virtual ~Delegate() {} | 41 virtual ~Delegate() {} |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 ActionBoxButtonController(Browser* browser, Delegate* delegate); | 44 ActionBoxButtonController(Browser* browser, Delegate* delegate); |
| 45 virtual ~ActionBoxButtonController(); | 45 virtual ~ActionBoxButtonController(); |
| 46 | 46 |
| 47 // Creates and populates an ActionBoxMenuModel according to the current | |
| 48 // state of the browser. | |
| 49 scoped_ptr<ActionBoxMenuModel> CreateMenuModel(); | |
|
Mike Wittman
2013/04/10 20:44:04
make private and expose via a test api. see e.g.
Rune Fevang
2013/04/10 21:17:48
I've ended up adding this function a couple of tim
Mike Wittman
2013/04/10 22:16:01
The delegate doesn't appear to be providing a lot
| |
| 50 | |
| 47 // Notifies this that the action box button has been clicked. | 51 // Notifies this that the action box button has been clicked. |
| 48 // Methods on the Delegate may be called re-entrantly. | 52 // Methods on the Delegate may be called re-entrantly. |
| 49 void OnButtonClicked(); | 53 void OnButtonClicked(); |
| 50 | 54 |
| 51 // Overridden from ui::SimpleMenuModel::Delegate: | 55 // Overridden from ui::SimpleMenuModel::Delegate: |
| 52 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 56 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
| 53 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 57 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
| 54 virtual bool GetAcceleratorForCommandId( | 58 virtual bool GetAcceleratorForCommandId( |
| 55 int command_id, | 59 int command_id, |
| 56 ui::Accelerator* accelerator) OVERRIDE; | 60 ui::Accelerator* accelerator) OVERRIDE; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 77 | 81 |
| 78 // The command ID to assign to the next dynamic entry that needs one. | 82 // The command ID to assign to the next dynamic entry that needs one. |
| 79 int next_command_id_; | 83 int next_command_id_; |
| 80 | 84 |
| 81 content::NotificationRegistrar registrar_; | 85 content::NotificationRegistrar registrar_; |
| 82 | 86 |
| 83 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonController); | 87 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonController); |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ | 90 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_BUTTON_CONTROLLER_H_ |
| OLD | NEW |