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

Unified Diff: chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.cc

Issue 1117893002: Moving extension code out of "components/" to avoid layering violations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nit. Created 5 years, 7 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/renderer_context_menu/context_menu_content_type_platform_app.cc
diff --git a/chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.cc b/chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.cc
index 9fdf92d07248cc02968b34b2aa3bf344490c3ccc..3df598de7e9f4c9f6b843cfd8c69f14e1746716d 100644
--- a/chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.cc
+++ b/chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.cc
@@ -6,9 +6,14 @@
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
+#include "content/public/browser/web_contents.h"
+#include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
+using extensions::Extension;
+using extensions::ProcessManager;
+
ContextMenuContentTypePlatformApp::ContextMenuContentTypePlatformApp(
content::WebContents* web_contents,
const content::ContextMenuParams& params)
@@ -18,6 +23,13 @@ ContextMenuContentTypePlatformApp::ContextMenuContentTypePlatformApp(
ContextMenuContentTypePlatformApp::~ContextMenuContentTypePlatformApp() {
}
+const Extension* ContextMenuContentTypePlatformApp::GetExtension() const {
+ ProcessManager* process_manager =
+ ProcessManager::Get(source_web_contents()->GetBrowserContext());
+ return process_manager->GetExtensionForWebContents(
+ source_web_contents());
+}
+
bool ContextMenuContentTypePlatformApp::SupportsGroup(int group) {
const extensions::Extension* platform_app = GetExtension();

Powered by Google App Engine
This is Rietveld 408576698