| 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 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WebLocalFrameImpl; | 12 class WebLocalFrameImpl; |
| 13 class WebViewImpl; | 13 class WebViewImpl; |
| 14 | 14 |
| 15 class InspectorEmulationAgent final : public InspectorBaseAgent<InspectorEmulati
onAgent, protocol::Frontend::Emulation>, public protocol::Backend::Emulation { | 15 class InspectorEmulationAgent final : public InspectorBaseAgent<InspectorEmulati
onAgent, protocol::Frontend::Emulation>, public protocol::Backend::Emulation { |
| 16 WTF_MAKE_NONCOPYABLE(InspectorEmulationAgent); | 16 WTF_MAKE_NONCOPYABLE(InspectorEmulationAgent); |
| 17 public: | 17 public: |
| 18 class Client { | 18 class Client { |
| 19 public: | 19 public: |
| 20 virtual ~Client() {} | 20 virtual ~Client() {} |
| 21 | 21 |
| 22 virtual void setCPUThrottlingRate(double rate) {} | 22 virtual void setCPUThrottlingRate(double rate) {} |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 static PassOwnPtrWillBeRawPtr<InspectorEmulationAgent> create(WebLocalFrameI
mpl*, Client*); | 25 static RawPtr<InspectorEmulationAgent> create(WebLocalFrameImpl*, Client*); |
| 26 ~InspectorEmulationAgent() override; | 26 ~InspectorEmulationAgent() override; |
| 27 | 27 |
| 28 // protocol::Dispatcher::EmulationCommandHandler implementation. | 28 // protocol::Dispatcher::EmulationCommandHandler implementation. |
| 29 void resetPageScaleFactor(ErrorString*) override; | 29 void resetPageScaleFactor(ErrorString*) override; |
| 30 void setPageScaleFactor(ErrorString*, double in_pageScaleFactor) override; | 30 void setPageScaleFactor(ErrorString*, double in_pageScaleFactor) override; |
| 31 void setScriptExecutionDisabled(ErrorString*, bool in_value) override; | 31 void setScriptExecutionDisabled(ErrorString*, bool in_value) override; |
| 32 void setTouchEmulationEnabled(ErrorString*, bool in_enabled, const protocol:
:Maybe<String>& in_configuration) override; | 32 void setTouchEmulationEnabled(ErrorString*, bool in_enabled, const protocol:
:Maybe<String>& in_configuration) override; |
| 33 void setEmulatedMedia(ErrorString*, const String& in_media) override; | 33 void setEmulatedMedia(ErrorString*, const String& in_media) override; |
| 34 void setCPUThrottlingRate(ErrorString*, double in_rate) override; | 34 void setCPUThrottlingRate(ErrorString*, double in_rate) override; |
| 35 | 35 |
| 36 // InspectorBaseAgent overrides. | 36 // InspectorBaseAgent overrides. |
| 37 void disable(ErrorString*) override; | 37 void disable(ErrorString*) override; |
| 38 void restore() override; | 38 void restore() override; |
| 39 | 39 |
| 40 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); | 43 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); |
| 44 WebViewImpl* webViewImpl(); | 44 WebViewImpl* webViewImpl(); |
| 45 | 45 |
| 46 RawPtrWillBeMember<WebLocalFrameImpl> m_webLocalFrameImpl; | 46 Member<WebLocalFrameImpl> m_webLocalFrameImpl; |
| 47 Client* m_client; | 47 Client* m_client; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| 51 | 51 |
| 52 #endif // !defined(InspectorEmulationAgent_h) | 52 #endif // !defined(InspectorEmulationAgent_h) |
| OLD | NEW |