| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 InspectorEmulationAgent_h | 5 #ifndef InspectorEmulationAgent_h |
| 6 #define InspectorEmulationAgent_h | 6 #define InspectorEmulationAgent_h |
| 7 | 7 |
| 8 #include "core/inspector/InspectorBaseAgent.h" | 8 #include "core/inspector/InspectorBaseAgent.h" |
| 9 #include "core/inspector/protocol/Emulation.h" | 9 #include "core/inspector/protocol/Emulation.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class WebLocalFrameImpl; | 13 class WebLocalFrameBase; |
| 14 class WebViewBase; | 14 class WebViewBase; |
| 15 | 15 |
| 16 namespace protocol { | 16 namespace protocol { |
| 17 namespace DOM { | 17 namespace DOM { |
| 18 class RGBA; | 18 class RGBA; |
| 19 } // namespace DOM | 19 } // namespace DOM |
| 20 } // namespace protocol | 20 } // namespace protocol |
| 21 | 21 |
| 22 class InspectorEmulationAgent final | 22 class InspectorEmulationAgent final |
| 23 : public InspectorBaseAgent<protocol::Emulation::Metainfo> { | 23 : public InspectorBaseAgent<protocol::Emulation::Metainfo> { |
| 24 WTF_MAKE_NONCOPYABLE(InspectorEmulationAgent); | 24 WTF_MAKE_NONCOPYABLE(InspectorEmulationAgent); |
| 25 | 25 |
| 26 public: | 26 public: |
| 27 class Client { | 27 class Client { |
| 28 public: | 28 public: |
| 29 virtual ~Client() {} | 29 virtual ~Client() {} |
| 30 | 30 |
| 31 virtual void SetCPUThrottlingRate(double rate) {} | 31 virtual void SetCPUThrottlingRate(double rate) {} |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 static InspectorEmulationAgent* Create(WebLocalFrameImpl*, Client*); | 34 static InspectorEmulationAgent* Create(WebLocalFrameBase*, Client*); |
| 35 ~InspectorEmulationAgent() override; | 35 ~InspectorEmulationAgent() override; |
| 36 | 36 |
| 37 // protocol::Dispatcher::EmulationCommandHandler implementation. | 37 // protocol::Dispatcher::EmulationCommandHandler implementation. |
| 38 protocol::Response forceViewport(double x, double y, double scale) override; | 38 protocol::Response forceViewport(double x, double y, double scale) override; |
| 39 protocol::Response resetViewport() override; | 39 protocol::Response resetViewport() override; |
| 40 protocol::Response resetPageScaleFactor() override; | 40 protocol::Response resetPageScaleFactor() override; |
| 41 protocol::Response setPageScaleFactor(double) override; | 41 protocol::Response setPageScaleFactor(double) override; |
| 42 protocol::Response setScriptExecutionDisabled(bool value) override; | 42 protocol::Response setScriptExecutionDisabled(bool value) override; |
| 43 protocol::Response setTouchEmulationEnabled( | 43 protocol::Response setTouchEmulationEnabled( |
| 44 bool enabled, | 44 bool enabled, |
| 45 protocol::Maybe<String> configuration) override; | 45 protocol::Maybe<String> configuration) override; |
| 46 protocol::Response setEmulatedMedia(const String&) override; | 46 protocol::Response setEmulatedMedia(const String&) override; |
| 47 protocol::Response setCPUThrottlingRate(double) override; | 47 protocol::Response setCPUThrottlingRate(double) override; |
| 48 protocol::Response setVirtualTimePolicy( | 48 protocol::Response setVirtualTimePolicy( |
| 49 const String& policy, | 49 const String& policy, |
| 50 protocol::Maybe<int> virtual_time_budget_ms) override; | 50 protocol::Maybe<int> virtual_time_budget_ms) override; |
| 51 protocol::Response setDefaultBackgroundColorOverride( | 51 protocol::Response setDefaultBackgroundColorOverride( |
| 52 protocol::Maybe<protocol::DOM::RGBA>) override; | 52 protocol::Maybe<protocol::DOM::RGBA>) override; |
| 53 | 53 |
| 54 // InspectorBaseAgent overrides. | 54 // InspectorBaseAgent overrides. |
| 55 protocol::Response disable() override; | 55 protocol::Response disable() override; |
| 56 void Restore() override; | 56 void Restore() override; |
| 57 | 57 |
| 58 DECLARE_VIRTUAL_TRACE(); | 58 DECLARE_VIRTUAL_TRACE(); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); | 61 InspectorEmulationAgent(WebLocalFrameBase*, Client*); |
| 62 WebViewBase* GetWebViewBase(); | 62 WebViewBase* GetWebViewBase(); |
| 63 void VirtualTimeBudgetExpired(); | 63 void VirtualTimeBudgetExpired(); |
| 64 | 64 |
| 65 Member<WebLocalFrameImpl> web_local_frame_impl_; | 65 Member<WebLocalFrameBase> web_local_frame_; |
| 66 Client* client_; | 66 Client* client_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| 70 | 70 |
| 71 #endif // !defined(InspectorEmulationAgent_h) | 71 #endif // !defined(InspectorEmulationAgent_h) |
| OLD | NEW |