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

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, 5 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 "ui/base/models/simple_menu_model.h"
12
13 class ExtensionService;
14
15 namespace extensions {
16 class Extension;
17 }
18
19 // A menu model that builds the contents of the action box menu.
20 class ActionBoxMenuModel : public ui::SimpleMenuModel,
Peter Kasting 2012/07/26 20:37:17 It seems a bit strange for this class to be both t
yefimt 2012/07/31 00:10:11 I'll look into it, dont have answer yet.
yefimt 2012/07/31 00:29:08 Done.
21 public ui::SimpleMenuModel::Delegate,
22 public content::NotificationObserver {
23 public:
24 explicit ActionBoxMenuModel(ExtensionService* extension_service);
25 virtual ~ActionBoxMenuModel();
26
27 size_t action_box_extensions_size();
tfarina 2012/07/26 02:43:40 minor/tiny nit: Do they asked you to write in unix
Peter Kasting 2012/07/26 20:37:17 The name here is correct, but the actual function
yefimt 2012/07/31 00:10:11 Done.
28 const extensions::Extension* GetActionBoxExtensionByIndex(int index);
Peter Kasting 2012/07/26 20:37:17 Nit: This function should also be renamed unix_hac
yefimt 2012/07/31 00:10:11 Done.
29
30 private:
31 typedef std::map<int, std::string> IdToEntensionIdMap;
32
33 // Overridden from SimpleMenuModel::Delegate.
34 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
35 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
36 virtual bool GetAcceleratorForCommandId(
37 int command_id,
38 ui::Accelerator* accelerator) OVERRIDE;
39 virtual void ExecuteCommand(int command_id) OVERRIDE;
40
41 // Overridden from content::NotificationObserver:
42 virtual void Observe(int type,
43 const content::NotificationSource& source,
44 const content::NotificationDetails& details) OVERRIDE;
45
46 ExtensionService* extension_service_;
47
48 IdToEntensionIdMap id_to_extension_id_;
Peter Kasting 2012/07/26 20:37:17 Nit: Add "map_" to the end of the name
yefimt 2012/07/31 00:10:11 Done.
49
50 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel);
51 };
52
53 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698