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

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

Issue 27119002: Add text autosizing override in the inspector. Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 return; 652 return;
653 653
654 Document* document = frame->document(); 654 Document* document = frame->document();
655 if (!document) { 655 if (!document) {
656 *errorString = "No Document instance to set HTML for"; 656 *errorString = "No Document instance to set HTML for";
657 return; 657 return;
658 } 658 }
659 DOMPatchSupport::patchDocument(*document, html); 659 DOMPatchSupport::patchDocument(*document, html);
660 } 660 }
661 661
662 void InspectorPageAgent::setDeviceMetricsOverride(ErrorString* errorString, int width, int height, double deviceScaleFactor, bool fitWindow) 662 void InspectorPageAgent::setDeviceMetricsOverride(ErrorString* errorString, int width, int height, double deviceScaleFactor, bool fitWindow, int textAutosizingO verride)
663 { 663 {
664 fprintf(stderr, "setting device metrics override to %d\n", textAutosizingOve rride);
665
664 const static long maxDimension = 10000000; 666 const static long maxDimension = 10000000;
665 667
666 if (width < 0 || height < 0 || width > maxDimension || height > maxDimension ) { 668 if (width < 0 || height < 0 || width > maxDimension || height > maxDimension ) {
667 *errorString = "Width and height values must be positive, not greater th an " + String::number(maxDimension); 669 *errorString = "Width and height values must be positive, not greater th an " + String::number(maxDimension);
668 return; 670 return;
669 } 671 }
670 672
671 if (!width ^ !height) { 673 if (!width ^ !height) {
672 *errorString = "Both width and height must be either zero or non-zero at once"; 674 *errorString = "Both width and height must be either zero or non-zero at once";
673 return; 675 return;
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 } 1264 }
1263 1265
1264 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1266 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1265 { 1267 {
1266 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1268 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1267 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1269 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1268 } 1270 }
1269 1271
1270 } // namespace WebCore 1272 } // namespace WebCore
1271 1273
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/devtools/front_end/OverridesSupport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698