From 5df6a5d0f551a7c277e1a908bb32957634a811f7 Mon Sep 17 00:00:00 2001 From: "dpolukhin@chromium.org" Date: Wed, 26 Jan 2011 07:39:12 +0000 Subject: 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 --- chrome/common/extensions/extension.cc | 8 ++++++++ chrome/common/extensions/extension.h | 3 +++ 2 files changed, 11 insertions(+) (limited to 'chrome/common') 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 { // 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. -- cgit v1.1