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

Unified Diff: Source/web/WebPermissionClient.cpp

Issue 1228873002: doesnt link in component build (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/platform/RuntimeEnabledFeatures.in ('k') | Source/web/web.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPermissionClient.cpp
diff --git a/Source/web/WebPermissionClient.cpp b/Source/web/WebPermissionClient.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..767aa9d39eba4e382dc9a64ffa68e44e6459ce91
--- /dev/null
+++ b/Source/web/WebPermissionClient.cpp
@@ -0,0 +1,27 @@
+// Copyright 2015 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 "config.h"
+#include "public/platform/modules/permissions/WebPermissionClient.h"
+
+#include "core/dom/Document.h"
+#include "core/dom/ExecutionContext.h"
+#include "modules/permissions/PermissionController.h"
+#include "public/platform/Platform.h"
+
+namespace blink {
+
+WebPermissionClient* WebPermissionClient::get(ExecutionContext* executionContext)
+{
+ if (executionContext->isDocument()) {
+ Document* document = toDocument(executionContext);
+ if (!document->frame())
+ return nullptr;
+ PermissionController* controller = PermissionController::from(*document->frame());
+ return controller ? controller->client() : nullptr;
+ }
+ return Platform::current()->permissionClient();
+}
+
+} // namespace blink
« no previous file with comments | « Source/platform/RuntimeEnabledFeatures.in ('k') | Source/web/web.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698