| 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 static PassOwnPtrWillBeRawPtr<InspectorEmulationAgent> create(WebLocalFrameI
mpl*); | 21 class Client { |
| 22 public: |
| 23 virtual ~Client() {} |
| 24 |
| 25 virtual void setCPUThrottlingRate(double rate) {} |
| 26 }; |
| 27 |
| 28 static PassOwnPtrWillBeRawPtr<InspectorEmulationAgent> create(WebLocalFrameI
mpl*, Client*); |
| 22 ~InspectorEmulationAgent() override; | 29 ~InspectorEmulationAgent() override; |
| 23 | 30 |
| 24 void viewportChanged(); | 31 void viewportChanged(); |
| 25 | 32 |
| 26 // InspectorBackendDispatcher::EmulationCommandHandler implementation. | 33 // InspectorBackendDispatcher::EmulationCommandHandler implementation. |
| 27 void resetScrollAndPageScaleFactor(ErrorString*) override; | 34 void resetScrollAndPageScaleFactor(ErrorString*) override; |
| 28 void setPageScaleFactor(ErrorString*, double pageScaleFactor) override; | 35 void setPageScaleFactor(ErrorString*, double pageScaleFactor) override; |
| 29 void setScriptExecutionDisabled(ErrorString*, bool) override; | 36 void setScriptExecutionDisabled(ErrorString*, bool) override; |
| 30 void setTouchEmulationEnabled(ErrorString*, bool enabled, const String* conf
iguration) override; | 37 void setTouchEmulationEnabled(ErrorString*, bool enabled, const String* conf
iguration) override; |
| 31 void setEmulatedMedia(ErrorString*, const String&) override; | 38 void setEmulatedMedia(ErrorString*, const String&) override; |
| 39 void setCPUThrottlingRate(ErrorString*, double rate) override; |
| 32 | 40 |
| 33 // InspectorBaseAgent overrides. | 41 // InspectorBaseAgent overrides. |
| 34 void disable(ErrorString*) override; | 42 void disable(ErrorString*) override; |
| 35 void restore() override; | 43 void restore() override; |
| 36 void discardAgent() override; | 44 void discardAgent() override; |
| 37 void didCommitLoadForLocalFrame(LocalFrame*) override; | 45 void didCommitLoadForLocalFrame(LocalFrame*) override; |
| 38 | 46 |
| 39 DECLARE_VIRTUAL_TRACE(); | 47 DECLARE_VIRTUAL_TRACE(); |
| 40 | 48 |
| 41 private: | 49 private: |
| 42 explicit InspectorEmulationAgent(WebLocalFrameImpl*); | 50 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); |
| 43 WebViewImpl* webViewImpl(); | 51 WebViewImpl* webViewImpl(); |
| 44 | 52 |
| 45 RawPtrWillBeMember<WebLocalFrameImpl> m_webLocalFrameImpl; | 53 RawPtrWillBeMember<WebLocalFrameImpl> m_webLocalFrameImpl; |
| 54 Client* m_client; |
| 46 }; | 55 }; |
| 47 | 56 |
| 48 | |
| 49 } // namespace blink | 57 } // namespace blink |
| 50 | 58 |
| 51 | |
| 52 #endif // !defined(InspectorEmulationAgent_h) | 59 #endif // !defined(InspectorEmulationAgent_h) |
| OLD | NEW |