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

Unified Diff: chrome/browser/renderer_host/chrome_render_view_host_observer.cc

Issue 10824188: Always send an ExtensionMsg_Loaded message before ExtensionMsg_ActivateExtension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_view_host_observer.cc
diff --git a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc
index 082a31521b3ccecaefb851079dc6317216611cf9..960c155902d1cfc742de0952a171f7e22e98b056 100644
--- a/chrome/browser/renderer_host/chrome_render_view_host_observer.cc
+++ b/chrome/browser/renderer_host/chrome_render_view_host_observer.cc
@@ -121,6 +121,13 @@ void ChromeRenderViewHostObserver::InitRenderViewForExtensions() {
case Extension::TYPE_HOSTED_APP:
case Extension::TYPE_PACKAGED_APP:
case Extension::TYPE_PLATFORM_APP:
+ // Always send a Loaded message before ActivateExtension so that
+ // ExtensionDispatcher knows what Extension is active, not just its ID.
+ // This is important for classifying the Extension's JavaScript context
+ // correctly (see ExtensionDispatcher::ClassifyJavaScriptContext).
+ Send(new ExtensionMsg_Loaded(
not at google - send to devlin 2012/08/06 22:54:48 Maybe this could go in InitRenderViewHostForExtens
+ std::vector<ExtensionMsg_Loaded_Params>(
+ 1, ExtensionMsg_Loaded_Params(extension))));
Send(new ExtensionMsg_ActivateExtension(extension->id()));
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698