| 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/InspectorFrontend.h" | 8 #include "core/InspectorFrontend.h" |
| 9 #include "core/inspector/InspectorBaseAgent.h" | 9 #include "core/inspector/InspectorBaseAgent.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class WebLocalFrameImpl; | 13 class WebLocalFrameImpl; |
| 14 class WebViewImpl; | 14 class WebViewImpl; |
| 15 | 15 |
| 16 using ErrorString = String; | 16 using ErrorString = String; |
| 17 | 17 |
| 18 class InspectorEmulationAgent final : public InspectorBaseAgent<InspectorEmulati
onAgent, InspectorFrontend::Emulation>, public InspectorBackendDispatcher::Emula
tionCommandHandler { | 18 class InspectorEmulationAgent final : public InspectorBaseAgent<InspectorEmulati
onAgent, InspectorFrontend::Emulation>, public InspectorBackendDispatcher::Emula
tionCommandHandler { |
| 19 WTF_MAKE_NONCOPYABLE(InspectorEmulationAgent); | 19 WTF_MAKE_NONCOPYABLE(InspectorEmulationAgent); |
| 20 public: | 20 public: |
| 21 class Client { | 21 class Client { |
| 22 public: | 22 public: |
| 23 virtual ~Client() {} | 23 virtual ~Client() {} |
| 24 | 24 |
| 25 virtual void setCPUThrottlingRate(double rate) {} | 25 virtual void setCPUThrottlingRate(double rate) {} |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 static PassOwnPtrWillBeRawPtr<InspectorEmulationAgent> create(WebLocalFrameI
mpl*, Client*); | 28 static RawPtr<InspectorEmulationAgent> create(WebLocalFrameImpl*, Client*); |
| 29 ~InspectorEmulationAgent() override; | 29 ~InspectorEmulationAgent() override; |
| 30 | 30 |
| 31 // InspectorBackendDispatcher::EmulationCommandHandler implementation. | 31 // InspectorBackendDispatcher::EmulationCommandHandler implementation. |
| 32 void resetPageScaleFactor(ErrorString*) override; | 32 void resetPageScaleFactor(ErrorString*) override; |
| 33 void setPageScaleFactor(ErrorString*, double pageScaleFactor) override; | 33 void setPageScaleFactor(ErrorString*, double pageScaleFactor) override; |
| 34 void setScriptExecutionDisabled(ErrorString*, bool) override; | 34 void setScriptExecutionDisabled(ErrorString*, bool) override; |
| 35 void setTouchEmulationEnabled(ErrorString*, bool enabled, const String* conf
iguration) override; | 35 void setTouchEmulationEnabled(ErrorString*, bool enabled, const String* conf
iguration) override; |
| 36 void setEmulatedMedia(ErrorString*, const String&) override; | 36 void setEmulatedMedia(ErrorString*, const String&) override; |
| 37 void setCPUThrottlingRate(ErrorString*, double rate) override; | 37 void setCPUThrottlingRate(ErrorString*, double rate) override; |
| 38 | 38 |
| 39 // InspectorBaseAgent overrides. | 39 // InspectorBaseAgent overrides. |
| 40 void disable(ErrorString*) override; | 40 void disable(ErrorString*) override; |
| 41 void restore() override; | 41 void restore() override; |
| 42 | 42 |
| 43 DECLARE_VIRTUAL_TRACE(); | 43 DECLARE_VIRTUAL_TRACE(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); | 46 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); |
| 47 WebViewImpl* webViewImpl(); | 47 WebViewImpl* webViewImpl(); |
| 48 | 48 |
| 49 RawPtrWillBeMember<WebLocalFrameImpl> m_webLocalFrameImpl; | 49 Member<WebLocalFrameImpl> m_webLocalFrameImpl; |
| 50 Client* m_client; | 50 Client* m_client; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace blink | 53 } // namespace blink |
| 54 | 54 |
| 55 #endif // !defined(InspectorEmulationAgent_h) | 55 #endif // !defined(InspectorEmulationAgent_h) |
| OLD | NEW |