summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authordpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 07:39:12 +0000
committerdpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 07:39:12 +0000
commit5df6a5d0f551a7c277e1a908bb32957634a811f7 (patch)
tree76ae750b5e93ffeff6307584c58ae1f825634b18 /chrome/common
parent97e539fdea1592b638834cedcec95f72de4c1de5 (diff)
downloadchromium_src-5df6a5d0f551a7c277e1a908bb32957634a811f7.zip
chromium_src-5df6a5d0f551a7c277e1a908bb32957634a811f7.tar.gz
chromium_src-5df6a5d0f551a7c277e1a908bb32957634a811f7.tar.bz2
Disable context menu for page_action and infobar for component extensions.
BUG=chromium-os:6923 TEST=manual Review URL: http://codereview.chromium.org/6354021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72618 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension.cc8
-rw-r--r--chrome/common/extensions/extension.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index d92bdef..a132baf 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -2319,6 +2319,14 @@ bool Extension::HasFullPermissions() const {
return plugins().size() > 0;
}
+bool Extension::ShowConfigureContextMenus() const {
+ // Don't show context menu for component extensions. We might want to show
+ // options for component extension button but now there is no component
+ // extension with options. All other menu items like uninstall have
+ // no sense for component extensions.
+ return location() != Extension::COMPONENT;
+}
+
bool Extension::IsAPIPermission(const std::string& str) const {
for (size_t i = 0; i < Extension::kNumPermissions; ++i) {
if (str == Extension::kPermissions[i].name) {
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index f58d273..95c2151 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -364,6 +364,9 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// having an NPAPI plugin).
bool HasFullPermissions() const;
+ // Whether context menu should be shown for page and browser actions.
+ bool ShowConfigureContextMenus() const;
+
// Returns the Homepage URL for this extension. If homepage_url was not
// specified in the manifest, this returns the Google Gallery URL. For
// third-party extensions, this returns a blank GURL.