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/inspector/InspectorState.h" | |
11 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
12 #include "platform/geometry/DoubleRect.h" | 11 #include "platform/geometry/DoubleRect.h" |
13 #include "web/DevToolsEmulator.h" | 12 #include "web/DevToolsEmulator.h" |
14 #include "web/WebLocalFrameImpl.h" | 13 #include "web/WebLocalFrameImpl.h" |
15 #include "web/WebViewImpl.h" | 14 #include "web/WebViewImpl.h" |
16 | 15 |
17 namespace blink { | 16 namespace blink { |
18 | 17 |
19 namespace EmulationAgentState { | 18 namespace EmulationAgentState { |
20 static const char scriptExecutionDisabled[] = "scriptExecutionDisabled"; | 19 static const char scriptExecutionDisabled[] = "scriptExecutionDisabled"; |
(...skipping 19 matching lines...) Expand all Loading... |
40 } | 39 } |
41 | 40 |
42 WebViewImpl* InspectorEmulationAgent::webViewImpl() | 41 WebViewImpl* InspectorEmulationAgent::webViewImpl() |
43 { | 42 { |
44 return m_webLocalFrameImpl->viewImpl(); | 43 return m_webLocalFrameImpl->viewImpl(); |
45 } | 44 } |
46 | 45 |
47 void InspectorEmulationAgent::restore() | 46 void InspectorEmulationAgent::restore() |
48 { | 47 { |
49 ErrorString error; | 48 ErrorString error; |
50 setScriptExecutionDisabled(&error, m_state->getBoolean(EmulationAgentState::
scriptExecutionDisabled)); | 49 setScriptExecutionDisabled(&error, m_state->booleanProperty(EmulationAgentSt
ate::scriptExecutionDisabled, false)); |
51 setTouchEmulationEnabled(&error, m_state->getBoolean(EmulationAgentState::to
uchEventEmulationEnabled), nullptr); | 50 setTouchEmulationEnabled(&error, m_state->booleanProperty(EmulationAgentStat
e::touchEventEmulationEnabled, false), nullptr); |
52 setEmulatedMedia(&error, m_state->getString(EmulationAgentState::emulatedMed
ia)); | 51 String emulatedMedia; |
| 52 m_state->getString(EmulationAgentState::emulatedMedia, &emulatedMedia); |
| 53 setEmulatedMedia(&error, emulatedMedia); |
53 } | 54 } |
54 | 55 |
55 void InspectorEmulationAgent::disable(ErrorString*) | 56 void InspectorEmulationAgent::disable(ErrorString*) |
56 { | 57 { |
57 ErrorString error; | 58 ErrorString error; |
58 setScriptExecutionDisabled(&error, false); | 59 setScriptExecutionDisabled(&error, false); |
59 setTouchEmulationEnabled(&error, false, nullptr); | 60 setTouchEmulationEnabled(&error, false, nullptr); |
60 setEmulatedMedia(&error, String()); | 61 setEmulatedMedia(&error, String()); |
61 } | 62 } |
62 | 63 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 frontend()->viewportChanged(viewport); | 129 frontend()->viewportChanged(viewport); |
129 } | 130 } |
130 | 131 |
131 DEFINE_TRACE(InspectorEmulationAgent) | 132 DEFINE_TRACE(InspectorEmulationAgent) |
132 { | 133 { |
133 visitor->trace(m_webLocalFrameImpl); | 134 visitor->trace(m_webLocalFrameImpl); |
134 InspectorBaseAgent::trace(visitor); | 135 InspectorBaseAgent::trace(visitor); |
135 } | 136 } |
136 | 137 |
137 } // namespace blink | 138 } // namespace blink |
OLD | NEW |