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

Unified Diff: content/shell/renderer/test_runner/WebPermissions.cpp

Issue 322713002: test_runner: Migrate WebPermissions to our Chromium C++ style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed 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: content/shell/renderer/test_runner/WebPermissions.cpp
diff --git a/content/shell/renderer/test_runner/WebPermissions.cpp b/content/shell/renderer/test_runner/WebPermissions.cpp
deleted file mode 100644
index 3e32aa2ac169c3667ef7101ae6adfcb4dd167f4e..0000000000000000000000000000000000000000
--- a/content/shell/renderer/test_runner/WebPermissions.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2013 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 "content/shell/renderer/test_runner/WebPermissions.h"
-
-#include "content/shell/renderer/test_runner/TestCommon.h"
-#include "content/shell/renderer/test_runner/WebTestDelegate.h"
-#include "third_party/WebKit/public/platform/WebCString.h"
-#include "third_party/WebKit/public/platform/WebURL.h"
-
-using namespace std;
-
-namespace content {
-
-WebPermissions::WebPermissions()
- : m_delegate(0)
-{
- reset();
-}
-
-WebPermissions::~WebPermissions()
-{
-}
-
-bool WebPermissions::allowImage(bool enabledPerSettings, const blink::WebURL& imageURL)
-{
- bool allowed = enabledPerSettings && m_imagesAllowed;
- if (m_dumpCallbacks && m_delegate)
- m_delegate->printMessage(std::string("PERMISSION CLIENT: allowImage(") + normalizeLayoutTestURL(imageURL.spec()) + "): " + (allowed ? "true" : "false") + "\n");
- return allowed;
-}
-
-bool WebPermissions::allowMedia(const blink::WebURL& imageURL)
-{
- bool allowed = m_mediaAllowed;
- if (m_dumpCallbacks && m_delegate)
- m_delegate->printMessage(std::string("PERMISSION CLIENT: allowMedia(") + normalizeLayoutTestURL(imageURL.spec()) + "): " + (allowed ? "true" : "false") + "\n");
- return allowed;
-}
-
-bool WebPermissions::allowScriptFromSource(bool enabledPerSettings, const blink::WebURL& scriptURL)
-{
- bool allowed = enabledPerSettings && m_scriptsAllowed;
- if (m_dumpCallbacks && m_delegate)
- m_delegate->printMessage(std::string("PERMISSION CLIENT: allowScriptFromSource(") + normalizeLayoutTestURL(scriptURL.spec()) + "): " + (allowed ? "true" : "false") + "\n");
- return allowed;
-}
-
-bool WebPermissions::allowStorage(bool)
-{
- return m_storageAllowed;
-}
-
-bool WebPermissions::allowPlugins(bool enabledPerSettings)
-{
- return enabledPerSettings && m_pluginsAllowed;
-}
-
-bool WebPermissions::allowDisplayingInsecureContent(bool enabledPerSettings, const blink::WebSecurityOrigin&, const blink::WebURL&)
-{
- return enabledPerSettings || m_displayingInsecureContentAllowed;
-}
-
-bool WebPermissions::allowRunningInsecureContent(bool enabledPerSettings, const blink::WebSecurityOrigin&, const blink::WebURL&)
-{
- return enabledPerSettings || m_runningInsecureContentAllowed;
-}
-
-void WebPermissions::setImagesAllowed(bool imagesAllowed)
-{
- m_imagesAllowed = imagesAllowed;
-}
-
-void WebPermissions::setMediaAllowed(bool mediaAllowed)
-{
- m_mediaAllowed = mediaAllowed;
-}
-
-void WebPermissions::setScriptsAllowed(bool scriptsAllowed)
-{
- m_scriptsAllowed = scriptsAllowed;
-}
-
-void WebPermissions::setStorageAllowed(bool storageAllowed)
-{
- m_storageAllowed = storageAllowed;
-}
-
-void WebPermissions::setPluginsAllowed(bool pluginsAllowed)
-{
- m_pluginsAllowed = pluginsAllowed;
-}
-
-void WebPermissions::setDisplayingInsecureContentAllowed(bool allowed)
-{
- m_displayingInsecureContentAllowed = allowed;
-}
-
-void WebPermissions::setRunningInsecureContentAllowed(bool allowed)
-{
- m_runningInsecureContentAllowed = allowed;
-}
-
-void WebPermissions::setDelegate(WebTestDelegate* delegate)
-{
- m_delegate = delegate;
-}
-
-void WebPermissions::setDumpCallbacks(bool dumpCallbacks)
-{
- m_dumpCallbacks = dumpCallbacks;
-}
-
-void WebPermissions::reset()
-{
- m_dumpCallbacks = false;
- m_imagesAllowed = true;
- m_mediaAllowed = true;
- m_scriptsAllowed = true;
- m_storageAllowed = true;
- m_pluginsAllowed = true;
- m_displayingInsecureContentAllowed = false;
- m_runningInsecureContentAllowed = false;
-}
-
-} // namespace content
« no previous file with comments | « content/shell/renderer/test_runner/WebPermissions.h ('k') | content/shell/renderer/test_runner/test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698