OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ | |
6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ | |
7 #pragma once | |
8 | |
9 #include <map> | |
10 #include "base/file_path.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "content/public/browser/notification_observer.h" | |
13 #include "ui/base/models/button_menu_item_model.h" | |
14 #include "ui/base/models/simple_menu_model.h" | |
15 | |
16 class ExtensionService; | |
17 | |
18 namespace extensions { | |
19 class Extension; | |
20 } | |
21 | |
22 | |
23 // A menu model that builds the contents of the action box menu. | |
24 class ActionBoxMenuModel : public ui::SimpleMenuModel, | |
25 public ui::SimpleMenuModel::Delegate, | |
26 public content::NotificationObserver { | |
27 public: | |
28 explicit ActionBoxMenuModel(ExtensionService* extension_service); | |
29 virtual ~ActionBoxMenuModel(); | |
30 | |
31 // Overridden for both ButtonMenuItemModel::Delegate and SimpleMenuModel: | |
Aaron Boodman
2012/06/12 05:53:44
If these aren't going to be called except through
yefimt
2012/06/13 01:24:21
Done.
| |
32 virtual void ExecuteCommand(int command_id) OVERRIDE; | |
33 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | |
34 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
35 virtual bool IsCommandIdVisible(int command_id) const OVERRIDE; | |
36 virtual bool GetAcceleratorForCommandId( | |
37 int command_id, ui::Accelerator* accelerator) OVERRIDE; | |
38 | |
39 // Overridden from content::NotificationObserver: | |
40 virtual void Observe(int type, | |
41 const content::NotificationSource& source, | |
42 const content::NotificationDetails& details) OVERRIDE; | |
43 | |
44 // Active box extensions. | |
45 size_t action_box_extensions_size(); | |
Aaron Boodman
2012/06/12 05:53:44
This helper doesn't seem necessary. Can just get t
yefimt
2012/06/13 01:24:21
Internally in this class everything coming from ex
| |
46 const extensions::Extension* GetActionBoxExtensionByIndex(int index); | |
47 | |
48 private: | |
49 void Build(); | |
50 | |
51 ExtensionService* extension_service_; | |
52 | |
53 typedef std::map<int, std::string> IdToEntensionId; | |
54 IdToEntensionId id_to_extension_id_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel); | |
57 }; | |
58 | |
59 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ | |
OLD | NEW |