| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ | |
| 6 #define COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "third_party/WebKit/public/web/WebContentSettingsClient.h" | |
| 10 | |
| 11 namespace test_runner { | |
| 12 | |
| 13 class LayoutTestRuntimeFlags; | |
| 14 class WebTestDelegate; | |
| 15 | |
| 16 class MockContentSettingsClient : public blink::WebContentSettingsClient { | |
| 17 public: | |
| 18 // Caller has to guarantee that |layout_test_runtime_flags| lives longer | |
| 19 // than the MockContentSettingsClient being constructed here. | |
| 20 MockContentSettingsClient(LayoutTestRuntimeFlags* layout_test_runtime_flags); | |
| 21 | |
| 22 ~MockContentSettingsClient() override; | |
| 23 | |
| 24 // blink::WebContentSettingsClient: | |
| 25 bool allowImage(bool enabled_per_settings, | |
| 26 const blink::WebURL& image_url) override; | |
| 27 bool allowScript(bool enabled_per_settings) override; | |
| 28 bool allowScriptFromSource(bool enabled_per_settings, | |
| 29 const blink::WebURL& script_url) override; | |
| 30 bool allowStorage(bool local) override; | |
| 31 bool allowPlugins(bool enabled_per_settings) override; | |
| 32 bool allowRunningInsecureContent(bool enabled_per_settings, | |
| 33 const blink::WebSecurityOrigin& context, | |
| 34 const blink::WebURL& url) override; | |
| 35 bool allowAutoplay(bool default_value) override; | |
| 36 | |
| 37 void SetDelegate(WebTestDelegate* delegate); | |
| 38 | |
| 39 private: | |
| 40 WebTestDelegate* delegate_; | |
| 41 | |
| 42 LayoutTestRuntimeFlags* flags_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(MockContentSettingsClient); | |
| 45 }; | |
| 46 | |
| 47 } // namespace test_runner | |
| 48 | |
| 49 #endif // COMPONENTS_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_ | |
| OLD | NEW |