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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 10113005: Remove EPM:all_hosts_ and use all_extension_views_ instead. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments addressed Created 8 years, 8 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/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 42519897a82c52141544fc1046a0ad296eff4d90..2c6d28f796c97b1baf1b215f1c516ecfdf11e6e4 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -24,9 +24,8 @@
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/download/download_util.h"
-#include "chrome/browser/extensions/extension_event_router.h"
-#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/net/browser_url_util.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
@@ -624,22 +623,13 @@ void RenderViewContextMenu::InitMenu() {
}
const Extension* RenderViewContextMenu::GetExtension() const {
- ExtensionProcessManager* process_manager =
- profile_->GetExtensionProcessManager();
+ ExtensionSystem* system = ExtensionSystem::Get(profile_);
// There is no process manager in some tests.
- if (!process_manager) {
+ if (!system->process_manager())
return NULL;
- }
-
- ExtensionProcessManager::const_iterator iter;
- for (iter = process_manager->begin(); iter != process_manager->end();
- ++iter) {
- ExtensionHost* host = *iter;
- if (host->host_contents() == source_web_contents_)
- return host->extension();
- }
- return NULL;
+ return system->process_manager()->GetExtensionForRenderViewHost(
+ source_web_contents_->GetRenderViewHost());
}
void RenderViewContextMenu::AppendPlatformAppItems(

Powered by Google App Engine
This is Rietveld 408576698