| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 virtual ~Client() {} | 24 virtual ~Client() {} |
| 25 | 25 |
| 26 virtual void setCPUThrottlingRate(double rate) {} | 26 virtual void setCPUThrottlingRate(double rate) {} |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 static InspectorEmulationAgent* create(WebLocalFrameImpl*, Client*); | 29 static InspectorEmulationAgent* create(WebLocalFrameImpl*, Client*); |
| 30 ~InspectorEmulationAgent() override; | 30 ~InspectorEmulationAgent() override; |
| 31 | 31 |
| 32 // protocol::Dispatcher::EmulationCommandHandler implementation. | 32 // protocol::Dispatcher::EmulationCommandHandler implementation. |
| 33 void forceViewport(ErrorString*, | 33 Response forceViewport(double x, double y, double scale) override; |
| 34 double in_x, | 34 Response resetViewport() override; |
| 35 double in_y, | 35 Response resetPageScaleFactor() override; |
| 36 double in_scale) override; | 36 Response setPageScaleFactor(double) override; |
| 37 void resetViewport(ErrorString*) override; | 37 Response setScriptExecutionDisabled(bool value) override; |
| 38 void resetPageScaleFactor(ErrorString*) override; | 38 Response setTouchEmulationEnabled(bool enabled, |
| 39 void setPageScaleFactor(ErrorString*, double in_pageScaleFactor) override; | 39 Maybe<String> configuration) override; |
| 40 void setScriptExecutionDisabled(ErrorString*, bool in_value) override; | 40 Response setEmulatedMedia(const String&) override; |
| 41 void setTouchEmulationEnabled( | 41 Response setCPUThrottlingRate(double) override; |
| 42 ErrorString*, | 42 Response setVirtualTimePolicy(const String& policy, |
| 43 bool in_enabled, | 43 Maybe<int> virtualTimeBudgetMs) override; |
| 44 const protocol::Maybe<String>& in_configuration) override; | |
| 45 void setEmulatedMedia(ErrorString*, const String& in_media) override; | |
| 46 void setCPUThrottlingRate(ErrorString*, double in_rate) override; | |
| 47 void setVirtualTimePolicy( | |
| 48 ErrorString*, | |
| 49 const String& in_policy, | |
| 50 const protocol::Maybe<int>& in_virtualTimeBudgetMs) override; | |
| 51 | 44 |
| 52 // InspectorBaseAgent overrides. | 45 // InspectorBaseAgent overrides. |
| 53 void disable(ErrorString*) override; | 46 Response disable() override; |
| 54 void restore() override; | 47 void restore() override; |
| 55 | 48 |
| 56 DECLARE_VIRTUAL_TRACE(); | 49 DECLARE_VIRTUAL_TRACE(); |
| 57 | 50 |
| 58 private: | 51 private: |
| 59 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); | 52 InspectorEmulationAgent(WebLocalFrameImpl*, Client*); |
| 60 WebViewImpl* webViewImpl(); | 53 WebViewImpl* webViewImpl(); |
| 61 void virtualTimeBudgetExpired(); | 54 void virtualTimeBudgetExpired(); |
| 62 | 55 |
| 63 Member<WebLocalFrameImpl> m_webLocalFrameImpl; | 56 Member<WebLocalFrameImpl> m_webLocalFrameImpl; |
| 64 Client* m_client; | 57 Client* m_client; |
| 65 std::unique_ptr<CancellableTaskFactory> m_virtualTimeBudgetExpiredTask; | 58 std::unique_ptr<CancellableTaskFactory> m_virtualTimeBudgetExpiredTask; |
| 66 }; | 59 }; |
| 67 | 60 |
| 68 } // namespace blink | 61 } // namespace blink |
| 69 | 62 |
| 70 #endif // !defined(InspectorEmulationAgent_h) | 63 #endif // !defined(InspectorEmulationAgent_h) |
| OLD | NEW |