Index: chrome/browser/extensions/api/guest_view/app_view_internal_api.cc |
diff --git a/chrome/browser/extensions/api/guest_view/app_view_internal_api.cc b/chrome/browser/extensions/api/guest_view/app_view_internal_api.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..20c25e2c8590622d762662aa6793ab0a30a52886 |
--- /dev/null |
+++ b/chrome/browser/extensions/api/guest_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/guest_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(), |
+ params->guest_instance_id, |
+ browser_context(), |
+ extension_id())) { |
+ return false; |
+ } |
+ return true; |
+} |
+ |
+} // namespace extensions |