Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Unified Diff: chrome/browser/extensions/api/guest_view/app_view_internal_api.cc

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Added tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698