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" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 m_state->doubleProperty(EmulationAgentState::forcedViewportY, 0), | 71 m_state->doubleProperty(EmulationAgentState::forcedViewportY, 0), |
72 m_state->doubleProperty(EmulationAgentState::forcedViewportScale, 1)); | 72 m_state->doubleProperty(EmulationAgentState::forcedViewportScale, 1)); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 void InspectorEmulationAgent::disable(ErrorString*) { | 76 void InspectorEmulationAgent::disable(ErrorString*) { |
77 ErrorString error; | 77 ErrorString error; |
78 setScriptExecutionDisabled(&error, false); | 78 setScriptExecutionDisabled(&error, false); |
79 setTouchEmulationEnabled(&error, false, protocol::Maybe<String>()); | 79 setTouchEmulationEnabled(&error, false, protocol::Maybe<String>()); |
80 setEmulatedMedia(&error, String()); | 80 setEmulatedMedia(&error, String()); |
| 81 setCPUThrottlingRate(&error, 1); |
81 resetViewport(&error); | 82 resetViewport(&error); |
82 } | 83 } |
83 | 84 |
84 void InspectorEmulationAgent::forceViewport(ErrorString* error, | 85 void InspectorEmulationAgent::forceViewport(ErrorString* error, |
85 double x, | 86 double x, |
86 double y, | 87 double y, |
87 double scale) { | 88 double scale) { |
88 if (x < 0 || y < 0) { | 89 if (x < 0 || y < 0) { |
89 *error = "Coordinates must be non-negative"; | 90 *error = "Coordinates must be non-negative"; |
90 return; | 91 return; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 WebViewScheduler::VirtualTimePolicy::PAUSE); | 175 WebViewScheduler::VirtualTimePolicy::PAUSE); |
175 frontend()->virtualTimeBudgetExpired(); | 176 frontend()->virtualTimeBudgetExpired(); |
176 } | 177 } |
177 | 178 |
178 DEFINE_TRACE(InspectorEmulationAgent) { | 179 DEFINE_TRACE(InspectorEmulationAgent) { |
179 visitor->trace(m_webLocalFrameImpl); | 180 visitor->trace(m_webLocalFrameImpl); |
180 InspectorBaseAgent::trace(visitor); | 181 InspectorBaseAgent::trace(visitor); |
181 } | 182 } |
182 | 183 |
183 } // namespace blink | 184 } // namespace blink |
OLD | NEW |