Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Side by Side Diff: chrome/browser/ui/toolbar/action_box_menu_model.h

Issue 10533086: Action box menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Action box menu Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
8 #include <map>
9
10 #include "content/public/browser/notification_observer.h"
11 #include "chrome/browser/extensions/extension_service.h"
12 #include "ui/base/models/simple_menu_model.h"
13
14 namespace extensions {
15 class Extension;
16 }
17
18 // A menu model that builds the contents of the action box menu.
19 class ActionBoxMenuModel : public ui::SimpleMenuModel,
20 public content::NotificationObserver {
21 public:
22 explicit ActionBoxMenuModel(ExtensionService* extension_service);
23 virtual ~ActionBoxMenuModel();
24
25 size_t action_box_extensions_size() {
26 return extension_service_->toolbar_model()->action_box_extensions_size();
27 }
28 const extensions::Extension* GetActionBoxExtensionByIndex(int index) {
29 return extension_service_->toolbar_model()->
30 action_box_menu_item_by_index(index);
31 }
32
33 private:
34 typedef std::map<int, std::string> IdToEntensionIdMap;
35
36 // Overridden from content::NotificationObserver:
37 virtual void Observe(int type,
38 const content::NotificationSource& source,
39 const content::NotificationDetails& details) OVERRIDE;
40
41 ExtensionService* extension_service_;
42
43 IdToEntensionIdMap id_to_extension_id_map_;
44
45 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel);
46 };
47
48 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698