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

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

Issue 10823289: Adding "send to mobile" and "add bookmark" to the action box menu and wiring to their respective ac… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied review comments. 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
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_MENU_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ 6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "content/public/browser/notification_observer.h" 10 #include "content/public/browser/notification_observer.h"
11 #include "chrome/browser/extensions/extension_service.h" 11 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/ui/browser_commands.h"
12 #include "ui/base/models/simple_menu_model.h" 13 #include "ui/base/models/simple_menu_model.h"
13 14
15 class Browser;
16
14 namespace extensions { 17 namespace extensions {
15 class Extension; 18 class Extension;
16 } 19 }
17 20
18 // A menu model that builds the contents of the action box menu. 21 // A menu model that builds the contents of the action box menu.
19 class ActionBoxMenuModel : public ui::SimpleMenuModel, 22 class ActionBoxMenuModel : public ui::SimpleMenuModel,
23 public ui::SimpleMenuModel::Delegate,
20 public content::NotificationObserver { 24 public content::NotificationObserver {
21 public: 25 public:
22 explicit ActionBoxMenuModel(ExtensionService* extension_service); 26 ActionBoxMenuModel(Browser* browser, ExtensionService* extension_service);
23 virtual ~ActionBoxMenuModel(); 27 virtual ~ActionBoxMenuModel();
24 28
25 const extensions::ExtensionList& action_box_menu_items() { 29 const extensions::ExtensionList& action_box_menu_items() {
26 return extension_service_->toolbar_model()->action_box_menu_items(); 30 return extension_service_->toolbar_model()->action_box_menu_items();
27 } 31 }
28 32
29 private: 33 private:
30 typedef std::map<int, std::string> IdToEntensionIdMap; 34 typedef std::map<int, std::string> IdToEntensionIdMap;
31 35
36 // Overridden from ui::SimpleMenuModel::Delegate:
37 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
38 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
39 virtual bool GetAcceleratorForCommandId(
40 int command_id,
41 ui::Accelerator* accelerator) OVERRIDE;
42 virtual void ExecuteCommand(int command_id) OVERRIDE;
43
32 // Overridden from content::NotificationObserver: 44 // Overridden from content::NotificationObserver:
33 virtual void Observe(int type, 45 virtual void Observe(int type,
34 const content::NotificationSource& source, 46 const content::NotificationSource& source,
35 const content::NotificationDetails& details) OVERRIDE; 47 const content::NotificationDetails& details) OVERRIDE;
36 48
49 Browser* browser_;
37 ExtensionService* extension_service_; 50 ExtensionService* extension_service_;
38 51
39 IdToEntensionIdMap id_to_extension_id_map_; 52 IdToEntensionIdMap id_to_extension_id_map_;
40 53
41 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel); 54 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel);
42 }; 55 };
43 56
44 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ 57 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/plus_decoration.mm ('k') | chrome/browser/ui/toolbar/action_box_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698