Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: Source/WebCore/inspector/InspectorPageAgent.cpp

Issue 11416095: Merge 134917 - Web Inspector: [Overrides] Device metrics get reset on navigation, yet remain in the… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 updateTouchEventEmulationInPage(false); 348 updateTouchEventEmulationInPage(false);
349 #endif 349 #endif
350 m_frontend = 0; 350 m_frontend = 0;
351 } 351 }
352 352
353 void InspectorPageAgent::restore() 353 void InspectorPageAgent::restore()
354 { 354 {
355 if (m_state->getBoolean(PageAgentState::pageAgentEnabled)) { 355 if (m_state->getBoolean(PageAgentState::pageAgentEnabled)) {
356 ErrorString error; 356 ErrorString error;
357 enable(&error); 357 enable(&error);
358 bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageA gentScriptExecutionDisabled);
359 setScriptExecutionDisabled(0, scriptExecutionDisabled);
360
361 int currentWidth = static_cast<int>(m_state->getLong(PageAgentState::pag eAgentScreenWidthOverride));
362 int currentHeight = static_cast<int>(m_state->getLong(PageAgentState::pa geAgentScreenHeightOverride));
363 double currentFontScaleFactor = m_state->getDouble(PageAgentState::pageA gentFontScaleFactorOverride);
364 bool currentFitWindow = m_state->getBoolean(PageAgentState::pageAgentFit Window);
365 updateViewMetrics(currentWidth, currentHeight, currentFontScaleFactor, c urrentFitWindow);
358 #if ENABLE(TOUCH_EVENTS) 366 #if ENABLE(TOUCH_EVENTS)
359 updateTouchEventEmulationInPage(m_state->getBoolean(PageAgentState::touc hEventEmulationEnabled)); 367 updateTouchEventEmulationInPage(m_state->getBoolean(PageAgentState::touc hEventEmulationEnabled));
360 #endif 368 #endif
361 } 369 }
362 } 370 }
363 371
364 void InspectorPageAgent::enable(ErrorString*) 372 void InspectorPageAgent::enable(ErrorString*)
365 { 373 {
366 m_state->setBoolean(PageAgentState::pageAgentEnabled, true); 374 m_state->setBoolean(PageAgentState::pageAgentEnabled, true);
367 bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgent ScriptExecutionDisabled);
368 setScriptExecutionDisabled(0, scriptExecutionDisabled);
369 m_instrumentingAgents->setInspectorPageAgent(this); 375 m_instrumentingAgents->setInspectorPageAgent(this);
370 } 376 }
371 377
372 void InspectorPageAgent::disable(ErrorString*) 378 void InspectorPageAgent::disable(ErrorString*)
373 { 379 {
374 m_state->setBoolean(PageAgentState::pageAgentEnabled, false); 380 m_state->setBoolean(PageAgentState::pageAgentEnabled, false);
375 m_instrumentingAgents->setInspectorPageAgent(0); 381 m_instrumentingAgents->setInspectorPageAgent(0);
376 382
377 setScriptExecutionDisabled(0, false); 383 setScriptExecutionDisabled(0, false);
378 384
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 if (!settings) 1120 if (!settings)
1115 return; 1121 return;
1116 1122
1117 settings->setShowDebugBorders(visible); 1123 settings->setShowDebugBorders(visible);
1118 settings->setShowRepaintCounter(visible); 1124 settings->setShowRepaintCounter(visible);
1119 } 1125 }
1120 1126
1121 } // namespace WebCore 1127 } // namespace WebCore
1122 1128
1123 #endif // ENABLE(INSPECTOR) 1129 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698