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

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 "base/file_path.h"
msw 2012/07/24 23:41:55 nit: is this include necessary?
yefimt 2012/07/25 21:09:21 Done.
11 #include "base/memory/scoped_ptr.h"
msw 2012/07/24 23:41:55 nit: is this include necessary?
yefimt 2012/07/25 21:09:21 Done.
12 #include "content/public/browser/notification_observer.h"
13 #include "ui/base/models/button_menu_item_model.h"
msw 2012/07/24 23:41:55 nit: is this include necessary?
yefimt 2012/07/25 21:09:21 Done.
14 #include "ui/base/models/simple_menu_model.h"
15
16 class ExtensionService;
17
18 namespace extensions {
19 class Extension;
20 }
21
22
msw 2012/07/24 23:41:55 nit: remove extra blank line.
yefimt 2012/07/25 21:09:21 Done.
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 // Active box extensions.
msw 2012/07/24 23:41:55 nit: "Action" not "Active"? Capitalize "Box"? Remo
yefimt 2012/07/25 21:09:21 Done.
32 size_t action_box_extensions_size();
33 const extensions::Extension* GetActionBoxExtensionByIndex(int index);
34
35 private:
36 typedef std::map<int, std::string> IdToEntensionIdMap;
37
38 // Overridden for both SimpleMenuModel::Delegate and SimpleMenuModel.
msw 2012/07/24 23:41:55 nit: These are all actually from SimpleMenuModel::
yefimt 2012/07/25 21:09:21 Done.
39 virtual void ExecuteCommand(int command_id) OVERRIDE;
msw 2012/07/24 23:41:55 nit: Match OVERRIDE declaration order and visibili
yefimt 2012/07/25 21:09:21 Done - for order As for visibility, aa@ asked me t
msw 2012/07/25 23:02:03 OK, there's no official style guide rule, so I won
Peter Kasting 2012/07/26 02:32:27 (FWIW, I didn't say anything on this patch to my k
40 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
41 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
42 virtual bool GetAcceleratorForCommandId(
43 int command_id,
44 ui::Accelerator* accelerator) OVERRIDE;
45
46 // Overridden from content::NotificationObserver:
47 virtual void Observe(int type,
48 const content::NotificationSource& source,
49 const content::NotificationDetails& details) OVERRIDE;
50
51 // Adds extensions to the model.
52 void Build();
msw 2012/07/24 23:41:55 nit: name standard |Init|? Or inline in ctor?
yefimt 2012/07/25 21:09:21 Moved
53
54 ExtensionService* extension_service_;
55
56 IdToEntensionIdMap id_to_extension_id_;
57
58 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel);
59 };
60
61 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698