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

Side by Side Diff: chrome/browser/extensions/extension_context_menu_model.h

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 // The menu model for the context menu for extension action icons (browser and 23 // The menu model for the context menu for extension action icons (browser and
24 // page actions). 24 // page actions).
25 class ExtensionContextMenuModel 25 class ExtensionContextMenuModel
26 : public base::RefCounted<ExtensionContextMenuModel>, 26 : public base::RefCounted<ExtensionContextMenuModel>,
27 public ui::SimpleMenuModel, 27 public ui::SimpleMenuModel,
28 public ui::SimpleMenuModel::Delegate, 28 public ui::SimpleMenuModel::Delegate,
29 public ExtensionUninstallDialog::Delegate { 29 public ExtensionUninstallDialog::Delegate {
30 public: 30 public:
31 enum MenuEntries {
32 NAME = 0,
33 CONFIGURE,
34 HIDE,
35 DISABLE,
36 UNINSTALL,
37 MANAGE
38 };
39
31 // Creates a menu model for the given extension action. 40 // Creates a menu model for the given extension action.
32 ExtensionContextMenuModel(const extensions::Extension* extension, 41 ExtensionContextMenuModel(const extensions::Extension* extension,
33 Browser* browser); 42 Browser* browser);
34 43
35 // SimpleMenuModel::Delegate overrides. 44 // SimpleMenuModel::Delegate overrides.
36 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; 45 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
37 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; 46 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
38 virtual bool GetAcceleratorForCommandId( 47 virtual bool GetAcceleratorForCommandId(
39 int command_id, 48 int command_id,
40 ui::Accelerator* accelerator) OVERRIDE; 49 ui::Accelerator* accelerator) OVERRIDE;
(...skipping 23 matching lines...) Expand all
64 73
65 Profile* profile_; 74 Profile* profile_;
66 75
67 // Keeps track of the extension uninstall dialog. 76 // Keeps track of the extension uninstall dialog.
68 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; 77 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_;
69 78
70 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); 79 DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel);
71 }; 80 };
72 81
73 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_ 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CONTEXT_MENU_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698