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 "components/guest_view/browser/guest_view_manager.h" | 8 #include "components/guest_view/browser/guest_view_manager.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
| 10 #include "content/public/browser/web_contents_source.h" |
10 #include "content/public/common/renderer_preferences.h" | 11 #include "content/public/common/renderer_preferences.h" |
11 #include "extensions/browser/api/app_runtime/app_runtime_api.h" | 12 #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
12 #include "extensions/browser/api/extensions_api_client.h" | 13 #include "extensions/browser/api/extensions_api_client.h" |
13 #include "extensions/browser/app_window/app_delegate.h" | 14 #include "extensions/browser/app_window/app_delegate.h" |
14 #include "extensions/browser/bad_message.h" | 15 #include "extensions/browser/bad_message.h" |
15 #include "extensions/browser/event_router.h" | 16 #include "extensions/browser/event_router.h" |
16 #include "extensions/browser/extension_host.h" | 17 #include "extensions/browser/extension_host.h" |
17 #include "extensions/browser/extension_registry.h" | 18 #include "extensions/browser/extension_registry.h" |
18 #include "extensions/browser/guest_view/app_view/app_view_constants.h" | 19 #include "extensions/browser/guest_view/app_view/app_view_constants.h" |
19 #include "extensions/browser/lazy_background_task_queue.h" | 20 #include "extensions/browser/lazy_background_task_queue.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 return; | 243 return; |
243 } | 244 } |
244 url_ = url; | 245 url_ = url; |
245 guest_extension_id_ = guest_extension->id(); | 246 guest_extension_id_ = guest_extension->id(); |
246 | 247 |
247 WebContents::CreateParams params( | 248 WebContents::CreateParams params( |
248 browser_context(), | 249 browser_context(), |
249 content::SiteInstance::CreateForURL(browser_context(), | 250 content::SiteInstance::CreateForURL(browser_context(), |
250 guest_extension->url())); | 251 guest_extension->url())); |
251 params.guest_delegate = this; | 252 params.guest_delegate = this; |
252 callback.Run(WebContents::Create(params)); | 253 WebContents* web_contents = WebContents::Create(params); |
| 254 WebContentsSource::CreateForWebContentsAndLocation(web_contents, FROM_HERE); |
| 255 callback.Run(web_contents); |
253 } | 256 } |
254 | 257 |
255 void AppViewGuest::LaunchAppAndFireEvent( | 258 void AppViewGuest::LaunchAppAndFireEvent( |
256 scoped_ptr<base::DictionaryValue> data, | 259 scoped_ptr<base::DictionaryValue> data, |
257 const WebContentsCreatedCallback& callback, | 260 const WebContentsCreatedCallback& callback, |
258 ExtensionHost* extension_host) { | 261 ExtensionHost* extension_host) { |
259 bool has_event_listener = EventRouter::Get(browser_context()) | 262 bool has_event_listener = EventRouter::Get(browser_context()) |
260 ->ExtensionHasEventListener( | 263 ->ExtensionHasEventListener( |
261 extension_host->extension()->id(), | 264 extension_host->extension()->id(), |
262 app_runtime::OnEmbedRequested::kEventName); | 265 app_runtime::OnEmbedRequested::kEventName); |
(...skipping 16 matching lines...) Expand all Loading... |
279 | 282 |
280 std::vector<int> AppViewGuest::GetAllRegisteredInstanceIdsForTesting() { | 283 std::vector<int> AppViewGuest::GetAllRegisteredInstanceIdsForTesting() { |
281 std::vector<int> instances; | 284 std::vector<int> instances; |
282 for (const auto& key_value : pending_response_map.Get()) { | 285 for (const auto& key_value : pending_response_map.Get()) { |
283 instances.push_back(key_value.first); | 286 instances.push_back(key_value.first); |
284 } | 287 } |
285 return instances; | 288 return instances; |
286 } | 289 } |
287 | 290 |
288 } // namespace extensions | 291 } // namespace extensions |
OLD | NEW |