Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/extensions/api/app_view/app_view_internal_api.h" | |
| 6 | |
| 7 #include "chrome/browser/guest_view/app_view/app_view_guest.h" | |
| 8 #include "chrome/common/extensions/api/app_view_internal.h" | |
| 9 | |
| 10 namespace appview = extensions::api::app_view_internal; | |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 AppViewInternalAttachFrameFunction:: | |
| 15 AppViewInternalAttachFrameFunction() { | |
| 16 } | |
| 17 | |
| 18 bool AppViewInternalAttachFrameFunction::RunAsync() { | |
| 19 scoped_ptr<appview::AttachFrame::Params> params( | |
| 20 appview::AttachFrame::Params::Create(*args_)); | |
| 21 EXTENSION_FUNCTION_VALIDATE(params.get()); | |
| 22 | |
| 23 GURL url = GetExtension()->GetResourceURL(params->url); | |
| 24 EXTENSION_FUNCTION_VALIDATE(url.is_valid()); | |
| 25 | |
| 26 if (!AppViewGuest::CompletePendingRequest(url, | |
| 27 params->guest_instance_id, | |
| 28 browser_context(), | |
| 29 extension_id())) { | |
| 30 return false; | |
| 31 } | |
| 32 | |
| 33 return true; | |
| 34 } | |
| 35 | |
| 36 AppViewInternalDenyRequestFunction:: | |
| 37 AppViewInternalDenyRequestFunction() { | |
| 38 } | |
| 39 | |
| 40 bool AppViewInternalDenyRequestFunction::RunAsync() { | |
| 41 scoped_ptr<appview::DenyRequest::Params> params( | |
| 42 appview::DenyRequest::Params::Create(*args_)); | |
| 43 EXTENSION_FUNCTION_VALIDATE(params.get()); | |
| 44 | |
| 45 if (!AppViewGuest::CompletePendingRequest(GURL(), | |
|
lazyboy
2014/07/08 18:24:33
Can we also add a note that: since GURL() is inval
Fady Samuel
2014/07/08 20:23:45
Done.
| |
| 46 params->guest_instance_id, | |
| 47 browser_context(), | |
| 48 extension_id())) { | |
| 49 return false; | |
| 50 } | |
| 51 return true; | |
| 52 } | |
| 53 | |
| 54 } // namespace extensions | |
| OLD | NEW |