| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ | 6 #define COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "third_party/WebKit/public/web/WebContentSettingsClient.h" | 9 #include "third_party/WebKit/public/web/WebContentSettingsClient.h" |
| 10 | 10 |
| 11 namespace test_runner { | 11 namespace test_runner { |
| 12 | 12 |
| 13 class LayoutTestRuntimeFlags; | 13 class LayoutTestRuntimeFlags; |
| 14 class WebTestDelegate; | 14 class WebTestDelegate; |
| 15 | 15 |
| 16 class MockContentSettingsClient : public blink::WebContentSettingsClient { | 16 class MockContentSettingsClient : public blink::WebContentSettingsClient { |
| 17 public: | 17 public: |
| 18 // Caller has to guarantee that |layout_test_runtime_flags| lives longer | 18 // Caller has to guarantee that |layout_test_runtime_flags| lives longer |
| 19 // than the MockContentSettingsClient being constructed here. | 19 // than the MockContentSettingsClient being constructed here. |
| 20 MockContentSettingsClient(LayoutTestRuntimeFlags* layout_test_runtime_flags); | 20 MockContentSettingsClient(LayoutTestRuntimeFlags* layout_test_runtime_flags); |
| 21 | 21 |
| 22 ~MockContentSettingsClient() override; | 22 ~MockContentSettingsClient() override; |
| 23 | 23 |
| 24 // blink::WebContentSettingsClient: | 24 // blink::WebContentSettingsClient: |
| 25 bool allowImage(bool enabledPerSettings, | 25 bool allowImage(bool enabled_per_settings, |
| 26 const blink::WebURL& imageURL) override; | 26 const blink::WebURL& image_url) override; |
| 27 bool allowMedia(const blink::WebURL& mediaURL) override; | 27 bool allowMedia(const blink::WebURL& media_url) override; |
| 28 bool allowScriptFromSource(bool enabledPerSettings, | 28 bool allowScript(bool enabled_per_settings) override; |
| 29 const blink::WebURL& scriptURL) override; | 29 bool allowScriptFromSource(bool enabled_per_settings, |
| 30 const blink::WebURL& script_url) override; |
| 30 bool allowStorage(bool local) override; | 31 bool allowStorage(bool local) override; |
| 31 bool allowPlugins(bool enabledPerSettings) override; | 32 bool allowPlugins(bool enabled_per_settings) override; |
| 32 bool allowDisplayingInsecureContent(bool enabledPerSettings, | 33 bool allowDisplayingInsecureContent(bool enabled_per_settings, |
| 33 const blink::WebURL&) override; | 34 const blink::WebURL& url) override; |
| 34 bool allowRunningInsecureContent(bool enabledPerSettings, | 35 bool allowRunningInsecureContent(bool enabled_per_settings, |
| 35 const blink::WebSecurityOrigin&, | 36 const blink::WebSecurityOrigin& context, |
| 36 const blink::WebURL&) override; | 37 const blink::WebURL& url) override; |
| 37 bool allowAutoplay(bool defaultValue) override; | 38 bool allowAutoplay(bool default_value) override; |
| 38 | 39 |
| 39 void SetDelegate(WebTestDelegate*); | 40 void SetDelegate(WebTestDelegate* delegate); |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 WebTestDelegate* delegate_; | 43 WebTestDelegate* delegate_; |
| 43 | 44 |
| 44 LayoutTestRuntimeFlags* flags_; | 45 LayoutTestRuntimeFlags* flags_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(MockContentSettingsClient); | 47 DISALLOW_COPY_AND_ASSIGN(MockContentSettingsClient); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace test_runner | 50 } // namespace test_runner |
| 50 | 51 |
| 51 #endif // COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ | 52 #endif // COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ |
| OLD | NEW |