| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/app_view/app_view_guest.h" | 5 #include "extensions/browser/guest_view/app_view/app_view_guest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/browser/render_view_host.h" | 8 #include "content/public/browser/render_view_host.h" |
| 9 #include "content/public/common/renderer_preferences.h" | 9 #include "content/public/common/renderer_preferences.h" |
| 10 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 10 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 queue->AddPendingTask(browser_context(), | 178 queue->AddPendingTask(browser_context(), |
| 179 guest_extension->id(), | 179 guest_extension->id(), |
| 180 base::Bind( | 180 base::Bind( |
| 181 &AppViewGuest::LaunchAppAndFireEvent, | 181 &AppViewGuest::LaunchAppAndFireEvent, |
| 182 weak_ptr_factory_.GetWeakPtr(), | 182 weak_ptr_factory_.GetWeakPtr(), |
| 183 base::Passed(make_scoped_ptr(data->DeepCopy())), | 183 base::Passed(make_scoped_ptr(data->DeepCopy())), |
| 184 callback)); | 184 callback)); |
| 185 return; | 185 return; |
| 186 } | 186 } |
| 187 | 187 |
| 188 ProcessManager* process_manager = | 188 ProcessManager* process_manager = ProcessManager::Get(browser_context()); |
| 189 ExtensionSystem::Get(browser_context())->process_manager(); | |
| 190 ExtensionHost* host = | 189 ExtensionHost* host = |
| 191 process_manager->GetBackgroundHostForExtension(guest_extension->id()); | 190 process_manager->GetBackgroundHostForExtension(guest_extension->id()); |
| 192 DCHECK(host); | 191 DCHECK(host); |
| 193 LaunchAppAndFireEvent(make_scoped_ptr(data->DeepCopy()), callback, host); | 192 LaunchAppAndFireEvent(make_scoped_ptr(data->DeepCopy()), callback, host); |
| 194 } | 193 } |
| 195 | 194 |
| 196 void AppViewGuest::DidAttachToEmbedder() { | 195 void AppViewGuest::DidAttachToEmbedder() { |
| 197 // This is called after the guest process has been attached to a host | 196 // This is called after the guest process has been attached to a host |
| 198 // element. This means that the host element knows how to route input | 197 // element. This means that the host element knows how to route input |
| 199 // events to the guest, and the guest knows how to get frames to the | 198 // events to the guest, and the guest knows how to get frames to the |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 249 |
| 251 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); | 250 scoped_ptr<base::DictionaryValue> embed_request(new base::DictionaryValue()); |
| 252 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); | 251 embed_request->SetInteger(appview::kGuestInstanceID, guest_instance_id()); |
| 253 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); | 252 embed_request->SetString(appview::kEmbedderID, embedder_extension_id()); |
| 254 embed_request->Set(appview::kData, data.release()); | 253 embed_request->Set(appview::kData, data.release()); |
| 255 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( | 254 AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( |
| 256 browser_context(), embed_request.Pass(), extension_host->extension()); | 255 browser_context(), embed_request.Pass(), extension_host->extension()); |
| 257 } | 256 } |
| 258 | 257 |
| 259 } // namespace extensions | 258 } // namespace extensions |
| OLD | NEW |