OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |