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

Unified Diff: extensions/browser/api/app_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: Fixed formatting Created 6 years, 5 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: extensions/browser/api/app_view/app_view_internal_api.cc
diff --git a/extensions/browser/api/app_view/app_view_internal_api.cc b/extensions/browser/api/app_view/app_view_internal_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..14a9527fc807da2c501aead9b97c5ffd11aca32f
--- /dev/null
+++ b/extensions/browser/api/app_view/app_view_internal_api.cc
@@ -0,0 +1,53 @@
+// 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 "extensions/browser/api/app_view/app_view_internal_api.h"
+
+#include "extensions/browser/api/extensions_api_client.h"
+#include "extensions/common/api/app_view_internal.h"
+
+
+namespace extensions {
+
+namespace appview = core_api::app_view_internal;
+
+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());
+
+ ExtensionsAPIClient* extensions_client = ExtensionsAPIClient::Get();
+ return extensions_client->AppViewInternalAttachFrame(
+ browser_context(),
+ url,
+ params->guest_instance_id,
+ extension_id());
+}
+
+AppViewInternalDenyRequestFunction::
+ AppViewInternalDenyRequestFunction() {
+}
+
+bool AppViewInternalDenyRequestFunction::RunAsync() {
+ scoped_ptr<appview::DenyRequest::Params> params(
+ appview::DenyRequest::Params::Create(*args_));
+ EXTENSION_FUNCTION_VALIDATE(params.get());
+
+ ExtensionsAPIClient* extensions_client = ExtensionsAPIClient::Get();
+ // Since the URL passed into AppViewGuest:::CompletePendingRequest is invalid,
+ // a new <appview> WebContents will not be created.
+ return extensions_client->AppViewInternalDenyRequest(
+ browser_context(),
+ params->guest_instance_id,
+ extension_id());
+}
+
+} // namespace extensions
« no previous file with comments | « extensions/browser/api/app_view/app_view_internal_api.h ('k') | extensions/browser/api/extensions_api_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698