OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 , m_webViewImpl(webViewImpl) | 202 , m_webViewImpl(webViewImpl) |
203 , m_attached(false) | 203 , m_attached(false) |
204 , m_generatingEvent(false) | 204 , m_generatingEvent(false) |
205 , m_deviceMetricsEnabled(false) | 205 , m_deviceMetricsEnabled(false) |
206 , m_emulateViewportEnabled(false) | 206 , m_emulateViewportEnabled(false) |
207 , m_originalViewportEnabled(false) | 207 , m_originalViewportEnabled(false) |
208 , m_isOverlayScrollbarsEnabled(false) | 208 , m_isOverlayScrollbarsEnabled(false) |
209 , m_touchEventEmulationEnabled(false) | 209 , m_touchEventEmulationEnabled(false) |
210 , m_originalTouchEnabled(false) | 210 , m_originalTouchEnabled(false) |
211 , m_originalDeviceSupportsMouse(false) | 211 , m_originalDeviceSupportsMouse(false) |
212 , m_originalDeviceSupportsTouch(false) | |
212 { | 213 { |
213 ASSERT(m_hostId > 0); | 214 ASSERT(m_hostId > 0); |
214 ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client); | 215 ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client); |
215 } | 216 } |
216 | 217 |
217 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() | 218 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() |
218 { | 219 { |
219 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); | 220 ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); |
220 if (m_attached) | 221 if (m_attached) |
221 blink::Platform::current()->currentThread()->removeTaskObserver(this); | 222 blink::Platform::current()->currentThread()->removeTaskObserver(this); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 } | 383 } |
383 } | 384 } |
384 | 385 |
385 void WebDevToolsAgentImpl::setTouchEventEmulationEnabled(bool enabled) | 386 void WebDevToolsAgentImpl::setTouchEventEmulationEnabled(bool enabled) |
386 { | 387 { |
387 if (m_touchEventEmulationEnabled == enabled) | 388 if (m_touchEventEmulationEnabled == enabled) |
388 return; | 389 return; |
389 | 390 |
390 if (!m_touchEventEmulationEnabled) { | 391 if (!m_touchEventEmulationEnabled) { |
391 m_originalTouchEnabled = RuntimeEnabledFeatures::touchEnabled(); | 392 m_originalTouchEnabled = RuntimeEnabledFeatures::touchEnabled(); |
392 if (m_webViewImpl->page()) | 393 if (m_webViewImpl->page()) { |
393 m_originalDeviceSupportsMouse = m_webViewImpl->page()->settings().de viceSupportsMouse(); | 394 m_originalDeviceSupportsMouse = m_webViewImpl->page()->settings().de viceSupportsMouse(); |
395 m_originalDeviceSupportsTouch = m_webViewImpl->page()->settings().de viceSupportsTouch(); | |
pfeldman
2014/04/21 12:34:00
Why is this not a part of Page agent?
dgozman
2014/04/21 13:25:47
Moved most to the PageAgent.
| |
396 } | |
394 } | 397 } |
395 RuntimeEnabledFeatures::setTouchEnabled(enabled ? true : m_originalTouchEnab led); | 398 RuntimeEnabledFeatures::setTouchEnabled(enabled ? true : m_originalTouchEnab led); |
396 if (m_webViewImpl->page()) | 399 if (m_webViewImpl->page()) { |
397 m_webViewImpl->page()->settings().setDeviceSupportsMouse(enabled ? false : m_originalDeviceSupportsMouse); | 400 m_webViewImpl->page()->settings().setDeviceSupportsMouse(enabled ? false : m_originalDeviceSupportsMouse); |
401 m_webViewImpl->page()->settings().setDeviceSupportsTouch(enabled ? true : m_originalDeviceSupportsTouch); | |
402 } | |
398 m_client->setTouchEventEmulationEnabled(enabled, m_emulateViewportEnabled); | 403 m_client->setTouchEventEmulationEnabled(enabled, m_emulateViewportEnabled); |
399 m_touchEventEmulationEnabled = enabled; | 404 m_touchEventEmulationEnabled = enabled; |
400 m_webViewImpl->mainFrameImpl()->frame()->view()->layout(); | 405 m_webViewImpl->mainFrameImpl()->frame()->view()->layout(); |
401 } | 406 } |
402 | 407 |
403 void WebDevToolsAgentImpl::enableViewportEmulation() | 408 void WebDevToolsAgentImpl::enableViewportEmulation() |
404 { | 409 { |
405 if (m_emulateViewportEnabled) | 410 if (m_emulateViewportEnabled) |
406 return; | 411 return; |
407 m_emulateViewportEnabled = true; | 412 m_emulateViewportEnabled = true; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
719 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) | 724 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_removeBreakpointCmd) |
720 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 725 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
721 } | 726 } |
722 | 727 |
723 void WebDevToolsAgent::processPendingMessages() | 728 void WebDevToolsAgent::processPendingMessages() |
724 { | 729 { |
725 PageScriptDebugServer::shared().runPendingTasks(); | 730 PageScriptDebugServer::shared().runPendingTasks(); |
726 } | 731 } |
727 | 732 |
728 } // namespace blink | 733 } // namespace blink |
OLD | NEW |