OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 , m_overlay(overlay) | 400 , m_overlay(overlay) |
401 , m_lastScriptIdentifier(0) | 401 , m_lastScriptIdentifier(0) |
402 , m_enabled(false) | 402 , m_enabled(false) |
403 , m_ignoreScriptsEnabledNotification(false) | 403 , m_ignoreScriptsEnabledNotification(false) |
404 , m_deviceMetricsOverridden(false) | 404 , m_deviceMetricsOverridden(false) |
405 , m_emulateMobileEnabled(false) | 405 , m_emulateMobileEnabled(false) |
406 , m_touchEmulationEnabled(false) | 406 , m_touchEmulationEnabled(false) |
407 , m_originalTouchEnabled(false) | 407 , m_originalTouchEnabled(false) |
408 , m_originalDeviceSupportsMouse(false) | 408 , m_originalDeviceSupportsMouse(false) |
409 , m_originalDeviceSupportsTouch(false) | 409 , m_originalDeviceSupportsTouch(false) |
| 410 , m_originalMaxTouchPoints(0) |
410 , m_embedderTextAutosizingEnabled(m_page->settings().textAutosizingEnabled()
) | 411 , m_embedderTextAutosizingEnabled(m_page->settings().textAutosizingEnabled()
) |
411 , m_embedderFontScaleFactor(m_page->settings().deviceScaleAdjustment()) | 412 , m_embedderFontScaleFactor(m_page->settings().deviceScaleAdjustment()) |
412 { | 413 { |
413 } | 414 } |
414 | 415 |
415 void InspectorPageAgent::setTextAutosizingEnabled(bool enabled) | 416 void InspectorPageAgent::setTextAutosizingEnabled(bool enabled) |
416 { | 417 { |
417 m_embedderTextAutosizingEnabled = enabled; | 418 m_embedderTextAutosizingEnabled = enabled; |
418 bool emulateMobileEnabled = m_enabled && m_deviceMetricsOverridden && m_emul
ateMobileEnabled; | 419 bool emulateMobileEnabled = m_enabled && m_deviceMetricsOverridden && m_emul
ateMobileEnabled; |
419 if (!emulateMobileEnabled) | 420 if (!emulateMobileEnabled) |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 m_client->setShowFPSCounter(m_state->getBoolean(PageAgentState::pageAgentSho
wFPSCounter) && !m_deviceMetricsOverridden); | 1326 m_client->setShowFPSCounter(m_state->getBoolean(PageAgentState::pageAgentSho
wFPSCounter) && !m_deviceMetricsOverridden); |
1326 m_client->setContinuousPaintingEnabled(m_state->getBoolean(PageAgentState::p
ageAgentContinuousPaintingEnabled) && !m_deviceMetricsOverridden); | 1327 m_client->setContinuousPaintingEnabled(m_state->getBoolean(PageAgentState::p
ageAgentContinuousPaintingEnabled) && !m_deviceMetricsOverridden); |
1327 } | 1328 } |
1328 | 1329 |
1329 void InspectorPageAgent::updateTouchEventEmulationInPage(bool enabled) | 1330 void InspectorPageAgent::updateTouchEventEmulationInPage(bool enabled) |
1330 { | 1331 { |
1331 if (!m_touchEmulationEnabled) { | 1332 if (!m_touchEmulationEnabled) { |
1332 m_originalTouchEnabled = RuntimeEnabledFeatures::touchEnabled(); | 1333 m_originalTouchEnabled = RuntimeEnabledFeatures::touchEnabled(); |
1333 m_originalDeviceSupportsMouse = m_page->settings().deviceSupportsMouse()
; | 1334 m_originalDeviceSupportsMouse = m_page->settings().deviceSupportsMouse()
; |
1334 m_originalDeviceSupportsTouch = m_page->settings().deviceSupportsTouch()
; | 1335 m_originalDeviceSupportsTouch = m_page->settings().deviceSupportsTouch()
; |
| 1336 m_originalMaxTouchPoints = m_page->settings().maxTouchPoints(); |
1335 } | 1337 } |
1336 RuntimeEnabledFeatures::setTouchEnabled(enabled ? true : m_originalTouchEnab
led); | 1338 RuntimeEnabledFeatures::setTouchEnabled(enabled ? true : m_originalTouchEnab
led); |
1337 if (!m_originalDeviceSupportsTouch) { | 1339 if (!m_originalDeviceSupportsTouch) { |
1338 m_page->settings().setDeviceSupportsMouse(enabled ? false : m_originalDe
viceSupportsMouse); | 1340 m_page->settings().setDeviceSupportsMouse(enabled ? false : m_originalDe
viceSupportsMouse); |
1339 m_page->settings().setDeviceSupportsTouch(enabled ? true : m_originalDev
iceSupportsTouch); | 1341 m_page->settings().setDeviceSupportsTouch(enabled ? true : m_originalDev
iceSupportsTouch); |
| 1342 // Currently emulation does not provide multiple touch points. |
| 1343 m_page->settings().setMaxTouchPoints(enabled ? 1 : m_originalMaxTouchPoi
nts); |
1340 } | 1344 } |
1341 m_touchEmulationEnabled = enabled; | 1345 m_touchEmulationEnabled = enabled; |
1342 m_client->setTouchEventEmulationEnabled(enabled); | 1346 m_client->setTouchEventEmulationEnabled(enabled); |
1343 m_page->deprecatedLocalMainFrame()->view()->layout(); | 1347 m_page->deprecatedLocalMainFrame()->view()->layout(); |
1344 } | 1348 } |
1345 | 1349 |
1346 void InspectorPageAgent::setTouchEmulationEnabled(ErrorString*, bool enabled) | 1350 void InspectorPageAgent::setTouchEmulationEnabled(ErrorString*, bool enabled) |
1347 { | 1351 { |
1348 if (m_state->getBoolean(PageAgentState::touchEventEmulationEnabled) == enabl
ed) | 1352 if (m_state->getBoolean(PageAgentState::touchEventEmulationEnabled) == enabl
ed) |
1349 return; | 1353 return; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 | 1429 |
1426 void InspectorPageAgent::trace(Visitor* visitor) | 1430 void InspectorPageAgent::trace(Visitor* visitor) |
1427 { | 1431 { |
1428 visitor->trace(m_page); | 1432 visitor->trace(m_page); |
1429 visitor->trace(m_injectedScriptManager); | 1433 visitor->trace(m_injectedScriptManager); |
1430 InspectorBaseAgent::trace(visitor); | 1434 InspectorBaseAgent::trace(visitor); |
1431 } | 1435 } |
1432 | 1436 |
1433 } // namespace blink | 1437 } // namespace blink |
1434 | 1438 |
OLD | NEW |