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

Unified Diff: chrome/browser/extensions/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: Addressed comments 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: 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

Powered by Google App Engine
This is Rietveld 408576698