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

Unified Diff: third_party/WebKit/Source/core/frame/ContentSettingsClient.cpp

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: added class-level comment Created 3 years, 8 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: third_party/WebKit/Source/core/frame/ContentSettingsClient.cpp
diff --git a/third_party/WebKit/Source/core/frame/ContentSettingsClient.cpp b/third_party/WebKit/Source/core/frame/ContentSettingsClient.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fcee68903d6df4744e316308cdff822ba889dcf7
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/ContentSettingsClient.cpp
@@ -0,0 +1,129 @@
+// Copyright 2017 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 "core/frame/ContentSettingsClient.h"
+
+#include "platform/ContentSettingCallbacks.h"
+#include "platform/weborigin/KURL.h"
+#include "platform/weborigin/SecurityOrigin.h"
+#include "public/platform/WebContentSettingCallbacks.h"
+#include "public/platform/WebContentSettingsClient.h"
+#include "public/platform/WebSecurityOrigin.h"
+#include "public/platform/WebURL.h"
+
+namespace blink {
+
+ContentSettingsClient::ContentSettingsClient() = default;
+
+bool ContentSettingsClient::allowDatabase(const String& name,
+ const String& displayName,
+ unsigned estimatedSize) {
+ if (m_client)
+ return m_client->allowDatabase(name, displayName, estimatedSize);
+ return true;
+}
+
+bool ContentSettingsClient::allowIndexedDB(const String& name,
+ SecurityOrigin* securityOrigin) {
+ if (m_client)
+ return m_client->allowIndexedDB(name, WebSecurityOrigin(securityOrigin));
+ return true;
+}
+
+bool ContentSettingsClient::requestFileSystemAccessSync() {
+ if (m_client)
+ return m_client->requestFileSystemAccessSync();
+ return true;
+}
+
+void ContentSettingsClient::requestFileSystemAccessAsync(
+ std::unique_ptr<ContentSettingCallbacks> callbacks) {
+ if (m_client)
+ m_client->requestFileSystemAccessAsync(std::move(callbacks));
+ else
+ callbacks->onAllowed();
+}
+
+bool ContentSettingsClient::allowScript(bool enabledPerSettings) {
+ if (m_client)
+ return m_client->allowScript(enabledPerSettings);
+ return enabledPerSettings;
+}
+
+bool ContentSettingsClient::allowScriptFromSource(bool enabledPerSettings,
+ const KURL& scriptURL) {
+ if (m_client)
+ return m_client->allowScriptFromSource(enabledPerSettings, scriptURL);
+ return enabledPerSettings;
+}
+
+bool ContentSettingsClient::allowPlugins(bool enabledPerSettings) {
+ if (m_client)
+ return m_client->allowPlugins(enabledPerSettings);
+ return enabledPerSettings;
+}
+
+bool ContentSettingsClient::allowImage(bool enabledPerSettings,
+ const KURL& imageURL) {
+ if (m_client)
+ return m_client->allowImage(enabledPerSettings, imageURL);
+ return enabledPerSettings;
+}
+
+bool ContentSettingsClient::allowReadFromClipboard(bool defaultValue) {
+ if (m_client)
+ return m_client->allowReadFromClipboard(defaultValue);
+ return defaultValue;
+}
+
+bool ContentSettingsClient::allowWriteToClipboard(bool defaultValue) {
+ if (m_client)
+ return m_client->allowWriteToClipboard(defaultValue);
+ return defaultValue;
+}
+
+bool ContentSettingsClient::allowStorage(StorageType type) {
+ if (m_client)
+ return m_client->allowStorage(type == StorageType::kLocal);
+ return true;
+}
+
+bool ContentSettingsClient::allowRunningInsecureContent(bool enabledPerSettings,
+ SecurityOrigin* origin,
+ const KURL& url) {
+ if (m_client) {
+ return m_client->allowRunningInsecureContent(
+ enabledPerSettings, WebSecurityOrigin(origin), url);
+ }
+ return enabledPerSettings;
+}
+
+bool ContentSettingsClient::allowMutationEvents(bool defaultValue) {
+ if (m_client)
+ return m_client->allowMutationEvents(defaultValue);
+ return defaultValue;
+}
+
+bool ContentSettingsClient::allowAutoplay(bool defaultValue) {
+ if (m_client)
+ return m_client->allowAutoplay(defaultValue);
+ return defaultValue;
+}
+
+void ContentSettingsClient::passiveInsecureContentFound(const KURL& url) {
+ if (m_client)
+ return m_client->passiveInsecureContentFound(url);
+}
+
+void ContentSettingsClient::didNotAllowScript() {
+ if (m_client)
+ m_client->didNotAllowScript();
+}
+
+void ContentSettingsClient::didNotAllowPlugins() {
+ if (m_client)
+ m_client->didNotAllowPlugins();
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/ContentSettingsClient.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698