Chromium Code Reviews| Index: chrome/browser/extensions/api/app_view/app_view_internal_api.cc |
| diff --git a/chrome/browser/extensions/api/app_view/app_view_internal_api.cc b/chrome/browser/extensions/api/app_view/app_view_internal_api.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c06de6772b68e8aaed0d96c499219df5c091ca4f |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/app_view/app_view_internal_api.cc |
| @@ -0,0 +1,54 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/extensions/api/app_view/app_view_internal_api.h" |
| + |
| +#include "chrome/browser/guest_view/app_view/app_view_guest.h" |
| +#include "chrome/common/extensions/api/app_view_internal.h" |
| + |
| +namespace appview = extensions::api::app_view_internal; |
| + |
| +namespace extensions { |
| + |
| +AppViewInternalAttachFrameFunction:: |
| + AppViewInternalAttachFrameFunction() { |
| +} |
| + |
| +bool AppViewInternalAttachFrameFunction::RunAsync() { |
| + scoped_ptr<appview::AttachFrame::Params> params( |
| + appview::AttachFrame::Params::Create(*args_)); |
| + EXTENSION_FUNCTION_VALIDATE(params.get()); |
| + |
| + GURL url = GetExtension()->GetResourceURL(params->url); |
| + EXTENSION_FUNCTION_VALIDATE(url.is_valid()); |
| + |
| + if (!AppViewGuest::CompletePendingRequest(url, |
| + params->guest_instance_id, |
| + browser_context(), |
| + extension_id())) { |
| + return false; |
| + } |
| + |
| + return true; |
| +} |
| + |
| +AppViewInternalDenyRequestFunction:: |
| + AppViewInternalDenyRequestFunction() { |
| +} |
| + |
| +bool AppViewInternalDenyRequestFunction::RunAsync() { |
| + scoped_ptr<appview::DenyRequest::Params> params( |
| + appview::DenyRequest::Params::Create(*args_)); |
| + EXTENSION_FUNCTION_VALIDATE(params.get()); |
| + |
| + 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.
|
| + params->guest_instance_id, |
| + browser_context(), |
| + extension_id())) { |
| + return false; |
| + } |
| + return true; |
| +} |
| + |
| +} // namespace extensions |