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

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

Issue 25735003: Add text autosizing override in the inspector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typeo Created 7 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/core/page/Settings.h » ('j') | 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 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 m_overlay->setOverride(InspectorOverlay::CSSMediaOverride, !media.isEmpty()) ; 1245 m_overlay->setOverride(InspectorOverlay::CSSMediaOverride, !media.isEmpty()) ;
1246 } 1246 }
1247 1247
1248 void InspectorPageAgent::applyEmulatedMedia(String* media) 1248 void InspectorPageAgent::applyEmulatedMedia(String* media)
1249 { 1249 {
1250 String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedM edia); 1250 String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedM edia);
1251 if (!emulatedMedia.isEmpty()) 1251 if (!emulatedMedia.isEmpty())
1252 *media = emulatedMedia; 1252 *media = emulatedMedia;
1253 } 1253 }
1254 1254
1255 void InspectorPageAgent::setTextAutosizingOverride(ErrorString*, bool enabled)
1256 {
1257 Settings& settings = m_page->settings();
1258 settings.setTextAutosizingEnabledOverride(enabled ? TextAutosizingOverride:: TextAutosizingOverrideEnabled : TextAutosizingOverride::TextAutosizingOverrideDi sabled);
1259 m_overlay->setOverride(InspectorOverlay::TextAutosizingOverride, true);
1260 }
1261
1262 void InspectorPageAgent::clearTextAutosizingOverride(ErrorString* errorString)
1263 {
1264 Settings& settings = m_page->settings();
1265 settings.setTextAutosizingEnabledOverride(TextAutosizingOverride::NoOverride );
1266 m_overlay->setOverride(InspectorOverlay::TextAutosizingOverride, false);
1267 }
1268
1255 void InspectorPageAgent::setForceCompositingMode(ErrorString* errorString, bool force) 1269 void InspectorPageAgent::setForceCompositingMode(ErrorString* errorString, bool force)
1256 { 1270 {
1257 Settings& settings = m_page->settings(); 1271 Settings& settings = m_page->settings();
1258 if (force && !settings.acceleratedCompositingEnabled()) { 1272 if (force && !settings.acceleratedCompositingEnabled()) {
1259 if (errorString) 1273 if (errorString)
1260 *errorString = "Compositing mode is not supported"; 1274 *errorString = "Compositing mode is not supported";
1261 return; 1275 return;
1262 } 1276 }
1263 m_state->setBoolean(PageAgentState::forceCompositingMode, force); 1277 m_state->setBoolean(PageAgentState::forceCompositingMode, force);
1264 if (settings.forceCompositingMode() == force) 1278 if (settings.forceCompositingMode() == force)
(...skipping 27 matching lines...) Expand all
1292 } 1306 }
1293 1307
1294 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1308 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1295 { 1309 {
1296 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1310 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1297 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1311 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1298 } 1312 }
1299 1313
1300 } // namespace WebCore 1314 } // namespace WebCore
1301 1315
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/core/page/Settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698