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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" 5 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/net/predictor.h" 9 #include "chrome/browser/net/predictor.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 process->GetID(), chrome::kFileScheme); 114 process->GetID(), chrome::kFileScheme);
115 } 115 }
116 } 116 }
117 117
118 switch (type) { 118 switch (type) {
119 case Extension::TYPE_EXTENSION: 119 case Extension::TYPE_EXTENSION:
120 case Extension::TYPE_USER_SCRIPT: 120 case Extension::TYPE_USER_SCRIPT:
121 case Extension::TYPE_HOSTED_APP: 121 case Extension::TYPE_HOSTED_APP:
122 case Extension::TYPE_PACKAGED_APP: 122 case Extension::TYPE_PACKAGED_APP:
123 case Extension::TYPE_PLATFORM_APP: 123 case Extension::TYPE_PLATFORM_APP:
124 // Always send a Loaded message before ActivateExtension so that
125 // ExtensionDispatcher knows what Extension is active, not just its ID.
126 // This is important for classifying the Extension's JavaScript context
127 // correctly (see ExtensionDispatcher::ClassifyJavaScriptContext).
128 Send(new ExtensionMsg_Loaded(
not at google - send to devlin 2012/08/06 22:54:48 Maybe this could go in InitRenderViewHostForExtens
129 std::vector<ExtensionMsg_Loaded_Params>(
130 1, ExtensionMsg_Loaded_Params(extension))));
124 Send(new ExtensionMsg_ActivateExtension(extension->id())); 131 Send(new ExtensionMsg_ActivateExtension(extension->id()));
125 break; 132 break;
126 133
127 case Extension::TYPE_UNKNOWN: 134 case Extension::TYPE_UNKNOWN:
128 case Extension::TYPE_THEME: 135 case Extension::TYPE_THEME:
129 break; 136 break;
130 } 137 }
131 } 138 }
132 139
133 const Extension* ChromeRenderViewHostObserver::GetExtension() { 140 const Extension* ChromeRenderViewHostObserver::GetExtension() {
(...skipping 29 matching lines...) Expand all
163 if (process_manager) 170 if (process_manager)
164 process_manager->UnregisterRenderViewHost(rvh); 171 process_manager->UnregisterRenderViewHost(rvh);
165 } 172 }
166 173
167 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { 174 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() {
168 content::NotificationService::current()->Notify( 175 content::NotificationService::current()->Notify(
169 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, 176 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED,
170 content::Source<RenderViewHost>(render_view_host()), 177 content::Source<RenderViewHost>(render_view_host()),
171 content::NotificationService::NoDetails()); 178 content::NotificationService::NoDetails());
172 } 179 }
OLDNEW
« 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