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 "chrome/browser/extensions/api/guest_view/guest_view_internal_api.h" | 5 #include "chrome/browser/extensions/api/guest_view/guest_view_internal_api.h" |
6 | 6 |
7 #include "chrome/browser/guest_view/guest_view_base.h" | 7 #include "chrome/browser/guest_view/guest_view_base.h" |
8 #include "chrome/browser/guest_view/guest_view_manager.h" | 8 #include "chrome/browser/guest_view/guest_view_manager.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/extensions/api/guest_view_internal.h" | 10 #include "chrome/common/extensions/api/guest_view_internal.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &create_params)); | 28 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &create_params)); |
29 | 29 |
30 GuestViewManager* guest_view_manager = | 30 GuestViewManager* guest_view_manager = |
31 GuestViewManager::FromBrowserContext(browser_context()); | 31 GuestViewManager::FromBrowserContext(browser_context()); |
32 | 32 |
33 GuestViewManager::WebContentsCreatedCallback callback = | 33 GuestViewManager::WebContentsCreatedCallback callback = |
34 base::Bind(&GuestViewInternalCreateGuestFunction::CreateGuestCallback, | 34 base::Bind(&GuestViewInternalCreateGuestFunction::CreateGuestCallback, |
35 this); | 35 this); |
36 guest_view_manager->CreateGuest(view_type, | 36 guest_view_manager->CreateGuest(view_type, |
37 extension_id(), | 37 extension_id(), |
38 render_view_host()->GetProcess()->GetID(), | 38 GetAssociatedWebContents(), |
39 *create_params, | 39 *create_params, |
40 callback); | 40 callback); |
41 | 41 |
42 return true; | 42 return true; |
43 } | 43 } |
44 | 44 |
45 void GuestViewInternalCreateGuestFunction::CreateGuestCallback( | 45 void GuestViewInternalCreateGuestFunction::CreateGuestCallback( |
46 content::WebContents* guest_web_contents) { | 46 content::WebContents* guest_web_contents) { |
47 int guest_instance_id = 0; | 47 int guest_instance_id = 0; |
48 if (guest_web_contents) { | 48 if (guest_web_contents) { |
(...skipping 23 matching lines...) Expand all Loading... |
72 guest->SetAutoSize(params->params.enable_auto_size, | 72 guest->SetAutoSize(params->params.enable_auto_size, |
73 gfx::Size(params->params.min.width, | 73 gfx::Size(params->params.min.width, |
74 params->params.min.height), | 74 params->params.min.height), |
75 gfx::Size(params->params.max.width, | 75 gfx::Size(params->params.max.width, |
76 params->params.max.height)); | 76 params->params.max.height)); |
77 SendResponse(true); | 77 SendResponse(true); |
78 return true; | 78 return true; |
79 } | 79 } |
80 | 80 |
81 } // namespace extensions | 81 } // namespace extensions |
OLD | NEW |