| 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/api/guest_view/app_view/app_view_guest_internal_api
.h" | 5 #include "extensions/browser/api/guest_view/app_view/app_view_guest_internal_api
.h" |
| 6 | 6 |
| 7 #include "content/public/browser/render_frame_host.h" |
| 8 #include "content/public/browser/render_process_host.h" |
| 7 #include "extensions/browser/guest_view/app_view/app_view_guest.h" | 9 #include "extensions/browser/guest_view/app_view/app_view_guest.h" |
| 8 #include "extensions/common/api/app_view_guest_internal.h" | 10 #include "extensions/common/api/app_view_guest_internal.h" |
| 9 | 11 |
| 10 namespace extensions { | 12 namespace extensions { |
| 11 | 13 |
| 12 namespace appview = core_api::app_view_guest_internal; | 14 namespace appview = core_api::app_view_guest_internal; |
| 13 | 15 |
| 14 AppViewGuestInternalAttachFrameFunction:: | 16 AppViewGuestInternalAttachFrameFunction:: |
| 15 AppViewGuestInternalAttachFrameFunction() { | 17 AppViewGuestInternalAttachFrameFunction() { |
| 16 } | 18 } |
| 17 | 19 |
| 18 bool AppViewGuestInternalAttachFrameFunction::RunAsync() { | 20 bool AppViewGuestInternalAttachFrameFunction::RunAsync() { |
| 19 scoped_ptr<appview::AttachFrame::Params> params( | 21 scoped_ptr<appview::AttachFrame::Params> params( |
| 20 appview::AttachFrame::Params::Create(*args_)); | 22 appview::AttachFrame::Params::Create(*args_)); |
| 21 EXTENSION_FUNCTION_VALIDATE(params.get()); | 23 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 22 | 24 |
| 23 GURL url = extension()->GetResourceURL(params->url); | 25 GURL url = extension()->GetResourceURL(params->url); |
| 24 EXTENSION_FUNCTION_VALIDATE(url.is_valid()); | 26 EXTENSION_FUNCTION_VALIDATE(url.is_valid()); |
| 25 | 27 |
| 26 return AppViewGuest::CompletePendingRequest( | 28 return AppViewGuest::CompletePendingRequest( |
| 27 browser_context(), url, params->guest_instance_id, extension_id()); | 29 browser_context(), url, params->guest_instance_id, extension_id(), |
| 30 render_frame_host()->GetProcess()->GetID()); |
| 28 } | 31 } |
| 29 | 32 |
| 30 AppViewGuestInternalDenyRequestFunction:: | 33 AppViewGuestInternalDenyRequestFunction:: |
| 31 AppViewGuestInternalDenyRequestFunction() { | 34 AppViewGuestInternalDenyRequestFunction() { |
| 32 } | 35 } |
| 33 | 36 |
| 34 bool AppViewGuestInternalDenyRequestFunction::RunAsync() { | 37 bool AppViewGuestInternalDenyRequestFunction::RunAsync() { |
| 35 scoped_ptr<appview::DenyRequest::Params> params( | 38 scoped_ptr<appview::DenyRequest::Params> params( |
| 36 appview::DenyRequest::Params::Create(*args_)); | 39 appview::DenyRequest::Params::Create(*args_)); |
| 37 EXTENSION_FUNCTION_VALIDATE(params.get()); | 40 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 38 | 41 |
| 39 // Since the URL passed into AppViewGuest:::CompletePendingRequest is invalid, | 42 // Since the URL passed into AppViewGuest:::CompletePendingRequest is invalid, |
| 40 // a new <appview> WebContents will not be created. | 43 // a new <appview> WebContents will not be created. |
| 41 return AppViewGuest::CompletePendingRequest( | 44 return AppViewGuest::CompletePendingRequest( |
| 42 browser_context(), GURL(), params->guest_instance_id, extension_id()); | 45 browser_context(), GURL(), params->guest_instance_id, extension_id(), |
| 46 render_frame_host()->GetProcess()->GetID()); |
| 43 } | 47 } |
| 44 | 48 |
| 45 } // namespace extensions | 49 } // namespace extensions |
| OLD | NEW |