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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 7612016: Tie extension/app initialization to RenderView creation, not RenderViewHost creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move initialization to ChromeRenderViewHostObserver. Created 9 years, 4 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d811568fd75ec341187cc5f13ce896f05f9a26e0..e1baeadcb645322fea9943bd25aafba467677ac7 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -45,14 +45,12 @@
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_url_handler.h"
#include "content/browser/browsing_instance.h"
-#include "content/browser/child_process_security_policy.h"
#include "content/browser/debugger/devtools_handler.h"
#include "content/browser/plugin_process_host.h"
#include "content/browser/renderer_host/browser_render_process_host.h"
@@ -109,37 +107,19 @@ void InitRenderViewHostForExtensions(RenderViewHost* render_view_host) {
// Register the association between extension and SiteInstance with
// ExtensionProcessManager.
- // TODO(creis): Use this to replace SetInstalledAppForRenderer below.
+ // TODO(creis): Use this to replace SetInstalledAppForRenderer in
+ // ChromeRenderViewHostObserver::InitRenderViewHostForExtensions.
process_manager->RegisterExtensionSiteInstance(site_instance->id(),
extension->id());
- RenderProcessHost* process = render_view_host->process();
-
- if (extension->is_app()) {
- render_view_host->Send(
- new ExtensionMsg_ActivateApplication(extension->id()));
- // Record which, if any, installed app is associated with this process.
- // TODO(aa): Totally lame to store this state in a global map in extension
- // service. Can we get it from EPM instead?
- service->SetInstalledAppForRenderer(process->id(), extension);
- }
-
- // Some extensions use chrome:// URLs.
- Extension::Type type = extension->GetType();
- if (type == Extension::TYPE_EXTENSION ||
- type == Extension::TYPE_PACKAGED_APP) {
- ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
- process->id(), chrome::kChromeUIScheme);
- }
-
// Enable extension bindings for the renderer. Currently only extensions,
// packaged apps, and hosted component apps use extension bindings.
+ Extension::Type type = extension->GetType();
if (type == Extension::TYPE_EXTENSION ||
type == Extension::TYPE_USER_SCRIPT ||
type == Extension::TYPE_PACKAGED_APP ||
(type == Extension::TYPE_HOSTED_APP &&
extension->location() == Extension::COMPONENT)) {
- render_view_host->Send(new ExtensionMsg_ActivateExtension(extension->id()));
render_view_host->AllowBindings(BindingsPolicy::EXTENSION);
}
}

Powered by Google App Engine
This is Rietveld 408576698