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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 m_state->setBoolean(PageAgentState::pageAgentEnabled, false); | 411 m_state->setBoolean(PageAgentState::pageAgentEnabled, false); |
412 m_state->remove(PageAgentState::pageAgentScriptsToEvaluateOnLoad); | 412 m_state->remove(PageAgentState::pageAgentScriptsToEvaluateOnLoad); |
413 m_overlay->hide(); | 413 m_overlay->hide(); |
414 m_instrumentingAgents->setInspectorPageAgent(0); | 414 m_instrumentingAgents->setInspectorPageAgent(0); |
415 m_deviceMetricsOverridden = false; | 415 m_deviceMetricsOverridden = false; |
416 | 416 |
417 setShowPaintRects(0, false); | 417 setShowPaintRects(0, false); |
418 setShowDebugBorders(0, false); | 418 setShowDebugBorders(0, false); |
419 setShowFPSCounter(0, false); | 419 setShowFPSCounter(0, false); |
420 setEmulatedMedia(0, String()); | 420 setEmulatedMedia(0, String()); |
421 setContinuousPaintingEnabled(0, false); | 421 if (m_state->getBoolean(PageAgentState::pageAgentContinuousPaintingEnabled)) |
| 422 setContinuousPaintingEnabled(0, false); |
422 setShowScrollBottleneckRects(0, false); | 423 setShowScrollBottleneckRects(0, false); |
423 setShowViewportSizeOnResize(0, false, 0); | 424 setShowViewportSizeOnResize(0, false, 0); |
424 | 425 |
425 if (m_state->getBoolean(PageAgentState::touchEventEmulationEnabled)) { | 426 if (m_state->getBoolean(PageAgentState::touchEventEmulationEnabled)) { |
426 updateTouchEventEmulationInPage(false); | 427 updateTouchEventEmulationInPage(false); |
427 m_state->setBoolean(PageAgentState::touchEventEmulationEnabled, false); | 428 m_state->setBoolean(PageAgentState::touchEventEmulationEnabled, false); |
428 } | 429 } |
429 | 430 |
430 if (!deviceMetricsChanged(false, 0, 0, 0, false, false, 1, false)) | 431 if (!deviceMetricsChanged(false, 0, 0, 0, false, false, 1, false)) |
431 return; | 432 return; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 updateViewMetricsFromState(); | 729 updateViewMetricsFromState(); |
729 } | 730 } |
730 } | 731 } |
731 | 732 |
732 bool InspectorPageAgent::deviceMetricsChanged(bool enabled, int width, int heigh
t, double deviceScaleFactor, bool emulateViewport, bool fitWindow, double fontSc
aleFactor, bool textAutosizing) | 733 bool InspectorPageAgent::deviceMetricsChanged(bool enabled, int width, int heigh
t, double deviceScaleFactor, bool emulateViewport, bool fitWindow, double fontSc
aleFactor, bool textAutosizing) |
733 { | 734 { |
734 bool currentEnabled = m_state->getBoolean(PageAgentState::deviceMetricsOverr
ideEnabled); | 735 bool currentEnabled = m_state->getBoolean(PageAgentState::deviceMetricsOverr
ideEnabled); |
735 // These two always fit an int. | 736 // These two always fit an int. |
736 int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pageAge
ntScreenWidthOverride)); | 737 int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pageAge
ntScreenWidthOverride)); |
737 int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pageAg
entScreenHeightOverride)); | 738 int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pageAg
entScreenHeightOverride)); |
738 double currentDeviceScaleFactor = m_state->getDouble(PageAgentState::pageAge
ntDeviceScaleFactorOverride, 1); | 739 double currentDeviceScaleFactor = m_state->getDouble(PageAgentState::pageAge
ntDeviceScaleFactorOverride, 0); |
739 bool currentEmulateViewport = m_state->getBoolean(PageAgentState::pageAgentE
mulateViewport); | 740 bool currentEmulateViewport = m_state->getBoolean(PageAgentState::pageAgentE
mulateViewport); |
740 bool currentFitWindow = m_state->getBoolean(PageAgentState::pageAgentFitWind
ow); | 741 bool currentFitWindow = m_state->getBoolean(PageAgentState::pageAgentFitWind
ow); |
741 double currentFontScaleFactor = m_state->getDouble(PageAgentState::fontScale
Factor, 1); | 742 double currentFontScaleFactor = m_state->getDouble(PageAgentState::fontScale
Factor, 1); |
742 bool currentTextAutosizing = m_state->getBoolean(PageAgentState::pageAgentTe
xtAutosizingOverride); | 743 bool currentTextAutosizing = m_state->getBoolean(PageAgentState::pageAgentTe
xtAutosizingOverride); |
743 | 744 |
744 return enabled != currentEnabled || width != currentWidth || height != curre
ntHeight || deviceScaleFactor != currentDeviceScaleFactor || emulateViewport !=
currentEmulateViewport || fitWindow != currentFitWindow || fontScaleFactor != cu
rrentFontScaleFactor || textAutosizing != currentTextAutosizing; | 745 return enabled != currentEnabled |
| 746 || width != currentWidth |
| 747 || height != currentHeight |
| 748 || deviceScaleFactor != currentDeviceScaleFactor |
| 749 || emulateViewport != currentEmulateViewport |
| 750 || fitWindow != currentFitWindow |
| 751 || fontScaleFactor != currentFontScaleFactor |
| 752 || textAutosizing != currentTextAutosizing; |
745 } | 753 } |
746 | 754 |
747 void InspectorPageAgent::setShowPaintRects(ErrorString*, bool show) | 755 void InspectorPageAgent::setShowPaintRects(ErrorString*, bool show) |
748 { | 756 { |
749 m_state->setBoolean(PageAgentState::pageAgentShowPaintRects, show); | 757 m_state->setBoolean(PageAgentState::pageAgentShowPaintRects, show); |
750 m_client->setShowPaintRects(show); | 758 m_client->setShowPaintRects(show); |
751 | 759 |
752 if (!show && mainFrame() && mainFrame()->view()) | 760 if (!show && mainFrame() && mainFrame()->view()) |
753 mainFrame()->view()->invalidate(); | 761 mainFrame()->view()->invalidate(); |
754 } | 762 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 } | 1278 } |
1271 | 1279 |
1272 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) | 1280 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) |
1273 { | 1281 { |
1274 m_state->setBoolean(PageAgentState::showSizeOnResize, show); | 1282 m_state->setBoolean(PageAgentState::showSizeOnResize, show); |
1275 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; | 1283 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; |
1276 } | 1284 } |
1277 | 1285 |
1278 } // namespace WebCore | 1286 } // namespace WebCore |
1279 | 1287 |
OLD | NEW |