| 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 #include "web/InspectorEmulationAgent.h" | 5 #include "web/InspectorEmulationAgent.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameHost.h" | 7 #include "core/frame/FrameHost.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| 11 #include "platform/geometry/DoubleRect.h" | 11 #include "platform/geometry/DoubleRect.h" |
| 12 #include "public/platform/WebViewScheduler.h" |
| 12 #include "web/DevToolsEmulator.h" | 13 #include "web/DevToolsEmulator.h" |
| 13 #include "web/WebLocalFrameImpl.h" | 14 #include "web/WebLocalFrameImpl.h" |
| 14 #include "web/WebViewImpl.h" | 15 #include "web/WebViewImpl.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 namespace EmulationAgentState { | 19 namespace EmulationAgentState { |
| 19 static const char scriptExecutionDisabled[] = "scriptExecutionDisabled"; | 20 static const char scriptExecutionDisabled[] = "scriptExecutionDisabled"; |
| 20 static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled"; | 21 static const char touchEventEmulationEnabled[] = "touchEventEmulationEnabled"; |
| 21 static const char emulatedMedia[] = "emulatedMedia"; | 22 static const char emulatedMedia[] = "emulatedMedia"; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 { | 86 { |
| 86 m_state->setString(EmulationAgentState::emulatedMedia, media); | 87 m_state->setString(EmulationAgentState::emulatedMedia, media); |
| 87 webViewImpl()->page()->settings().setMediaTypeOverride(media); | 88 webViewImpl()->page()->settings().setMediaTypeOverride(media); |
| 88 } | 89 } |
| 89 | 90 |
| 90 void InspectorEmulationAgent::setCPUThrottlingRate(ErrorString*, double throttli
ngRate) | 91 void InspectorEmulationAgent::setCPUThrottlingRate(ErrorString*, double throttli
ngRate) |
| 91 { | 92 { |
| 92 m_client->setCPUThrottlingRate(throttlingRate); | 93 m_client->setCPUThrottlingRate(throttlingRate); |
| 93 } | 94 } |
| 94 | 95 |
| 96 void InspectorEmulationAgent::enableVirtualTime(ErrorString*) |
| 97 { |
| 98 m_webLocalFrameImpl->view()->scheduler()->enableVirtualTime(); |
| 99 } |
| 100 |
| 101 void InspectorEmulationAgent::setVirtualTimePolicy(ErrorString*, const String& i
n_policy) |
| 102 { |
| 103 m_webLocalFrameImpl->view()->scheduler()->setVirtualTimePolicy(in_policy); |
| 104 } |
| 105 |
| 95 DEFINE_TRACE(InspectorEmulationAgent) | 106 DEFINE_TRACE(InspectorEmulationAgent) |
| 96 { | 107 { |
| 97 visitor->trace(m_webLocalFrameImpl); | 108 visitor->trace(m_webLocalFrameImpl); |
| 98 InspectorBaseAgent::trace(visitor); | 109 InspectorBaseAgent::trace(visitor); |
| 99 } | 110 } |
| 100 | 111 |
| 101 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |