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/guest_view_base.h" | 5 #include "extensions/browser/guest_view/guest_view_base.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/ui/zoom/page_zoom.h" | 9 #include "components/ui/zoom/page_zoom.h" |
10 #include "components/ui/zoom/zoom_controller.h" | 10 #include "components/ui/zoom/zoom_controller.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 guest_web_contents->SetDelegate(this); | 255 guest_web_contents->SetDelegate(this); |
256 webcontents_guestview_map.Get().insert( | 256 webcontents_guestview_map.Get().insert( |
257 std::make_pair(guest_web_contents, this)); | 257 std::make_pair(guest_web_contents, this)); |
258 GuestViewManager::FromBrowserContext(browser_context_)-> | 258 GuestViewManager::FromBrowserContext(browser_context_)-> |
259 AddGuest(guest_instance_id_, guest_web_contents); | 259 AddGuest(guest_instance_id_, guest_web_contents); |
260 | 260 |
261 // Populate the view instance ID if we have it on creation. | 261 // Populate the view instance ID if we have it on creation. |
262 create_params.GetInteger(guestview::kParameterInstanceId, | 262 create_params.GetInteger(guestview::kParameterInstanceId, |
263 &view_instance_id_); | 263 &view_instance_id_); |
264 | 264 |
265 if (CanRunInDetachedState()) | 265 //if (CanRunInDetachedState()) |
266 SetUpSizing(create_params); | 266 // SetUpSizing(create_params); |
267 | 267 |
268 // Give the derived class an opportunity to perform additional initialization. | 268 // Give the derived class an opportunity to perform additional initialization. |
269 DidInitialize(create_params); | 269 DidInitialize(create_params); |
270 } | 270 } |
271 | 271 |
272 void GuestViewBase::LoadURLWithParams( | 272 void GuestViewBase::LoadURLWithParams( |
273 const content::NavigationController::LoadURLParams& load_params) { | 273 const content::NavigationController::LoadURLParams& load_params) { |
274 int guest_proxy_routing_id = host()->LoadURLWithParams(load_params); | 274 int guest_proxy_routing_id = host()->LoadURLWithParams(load_params); |
275 DCHECK(guest_proxy_routing_id_ == MSG_ROUTING_NONE || | 275 DCHECK(guest_proxy_routing_id_ == MSG_ROUTING_NONE || |
276 guest_proxy_routing_id == guest_proxy_routing_id_); | 276 guest_proxy_routing_id == guest_proxy_routing_id_); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 content::WebContents* GuestViewBase::CreateNewGuestWindow( | 417 content::WebContents* GuestViewBase::CreateNewGuestWindow( |
418 const content::WebContents::CreateParams& create_params) { | 418 const content::WebContents::CreateParams& create_params) { |
419 auto guest_manager = GuestViewManager::FromBrowserContext(browser_context()); | 419 auto guest_manager = GuestViewManager::FromBrowserContext(browser_context()); |
420 return guest_manager->CreateGuestWithWebContentsParams( | 420 return guest_manager->CreateGuestWithWebContentsParams( |
421 GetViewType(), | 421 GetViewType(), |
422 owner_web_contents(), | 422 owner_web_contents(), |
423 create_params); | 423 create_params); |
424 } | 424 } |
425 | 425 |
426 void GuestViewBase::DidAttach(int guest_proxy_routing_id) { | 426 void GuestViewBase::DidAttach(int guest_proxy_routing_id) { |
427 DCHECK(guest_proxy_routing_id_ == MSG_ROUTING_NONE || | 427 //DCHECK(guest_proxy_routing_id_ == MSG_ROUTING_NONE || |
428 guest_proxy_routing_id == guest_proxy_routing_id_); | 428 // guest_proxy_routing_id == guest_proxy_routing_id_); |
429 guest_proxy_routing_id_ = guest_proxy_routing_id; | 429 guest_proxy_routing_id_ = guest_proxy_routing_id; |
430 | 430 |
431 opener_lifetime_observer_.reset(); | 431 opener_lifetime_observer_.reset(); |
432 | 432 |
433 SetUpSizing(*attach_params()); | 433 SetUpSizing(*attach_params()); |
434 | 434 |
435 // Give the derived class an opportunity to perform some actions. | 435 // Give the derived class an opportunity to perform some actions. |
436 DidAttachToEmbedder(); | 436 DidAttachToEmbedder(); |
437 | 437 |
438 // Inform the associated GuestViewContainer that the contentWindow is ready. | 438 // Inform the associated GuestViewContainer that the contentWindow is ready. |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 void GuestViewBase::RegisterGuestViewTypes() { | 878 void GuestViewBase::RegisterGuestViewTypes() { |
879 AppViewGuest::Register(); | 879 AppViewGuest::Register(); |
880 ExtensionOptionsGuest::Register(); | 880 ExtensionOptionsGuest::Register(); |
881 ExtensionViewGuest::Register(); | 881 ExtensionViewGuest::Register(); |
882 MimeHandlerViewGuest::Register(); | 882 MimeHandlerViewGuest::Register(); |
883 SurfaceWorkerGuest::Register(); | 883 SurfaceWorkerGuest::Register(); |
884 WebViewGuest::Register(); | 884 WebViewGuest::Register(); |
885 } | 885 } |
886 | 886 |
887 } // namespace extensions | 887 } // namespace extensions |
OLD | NEW |