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

Unified Diff: chrome/browser/extensions/extension_menu_manager.cc

Issue 2811049: Add ability to limit when context menu items appear with url patterns.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_menu_manager.cc
===================================================================
--- chrome/browser/extensions/extension_menu_manager.cc (revision 52866)
+++ chrome/browser/extensions/extension_menu_manager.cc (working copy)
@@ -96,6 +96,9 @@
children_.push_back(item);
}
+const int ExtensionMenuManager::kAllowedSchemes =
+ URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS;
+
ExtensionMenuManager::ExtensionMenuManager() {
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources());
@@ -446,3 +449,9 @@
const std::string& extension_id) {
return icon_manager_.GetIcon(extension_id);
}
+
+// static
+bool ExtensionMenuManager::HasAllowedScheme(const GURL& url) {
+ URLPattern pattern(kAllowedSchemes);
+ return pattern.SetScheme(url.scheme());
+}
« no previous file with comments | « chrome/browser/extensions/extension_menu_manager.h ('k') | chrome/browser/tab_contents/render_view_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698