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

Side by Side Diff: Source/core/page/Settings.cpp

Issue 26929003: Add text autosizing override in the inspector. (Closed) 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) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserv ed.
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 , m_mediaTypeOverride("screen") 115 , m_mediaTypeOverride("screen")
116 , m_textAutosizingFontScaleFactor(1) 116 , m_textAutosizingFontScaleFactor(1)
117 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP 117 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
118 , m_textAutosizingWindowSizeOverride(320, 480) 118 , m_textAutosizingWindowSizeOverride(320, 480)
119 , m_textAutosizingEnabled(true) 119 , m_textAutosizingEnabled(true)
120 #else 120 #else
121 , m_textAutosizingEnabled(false) 121 , m_textAutosizingEnabled(false)
122 #endif 122 #endif
123 , m_useWideViewport(true) 123 , m_useWideViewport(true)
124 , m_loadWithOverviewMode(true) 124 , m_loadWithOverviewMode(true)
125 , m_textAutosizingOverride(NoOverride)
125 SETTINGS_INITIALIZER_LIST 126 SETTINGS_INITIALIZER_LIST
126 , m_isJavaEnabled(false) 127 , m_isJavaEnabled(false)
127 , m_loadsImagesAutomatically(false) 128 , m_loadsImagesAutomatically(false)
128 , m_areImagesEnabled(true) 129 , m_areImagesEnabled(true)
129 , m_arePluginsEnabled(false) 130 , m_arePluginsEnabled(false)
130 , m_isScriptEnabled(false) 131 , m_isScriptEnabled(false)
131 , m_dnsPrefetchingEnabled(false) 132 , m_dnsPrefetchingEnabled(false)
132 , m_touchEventEmulationEnabled(false) 133 , m_touchEventEmulationEnabled(false)
133 , m_openGLMultisamplingEnabled(false) 134 , m_openGLMultisamplingEnabled(false)
134 , m_viewportEnabled(false) 135 , m_viewportEnabled(false)
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 218
218 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled) 219 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
219 { 220 {
220 if (m_textAutosizingEnabled == textAutosizingEnabled) 221 if (m_textAutosizingEnabled == textAutosizingEnabled)
221 return; 222 return;
222 223
223 m_textAutosizingEnabled = textAutosizingEnabled; 224 m_textAutosizingEnabled = textAutosizingEnabled;
224 m_page->setNeedsRecalcStyleInAllFrames(); 225 m_page->setNeedsRecalcStyleInAllFrames();
225 } 226 }
226 227
228 bool Settings::textAutosizingEnabled() const
229 {
230 switch (m_textAutosizingOverride) {
231 case NoOverride:
232 return m_textAutosizingEnabled;
233 case Enabled:
234 return true;
235 case Disabled:
236 return false;
237 default:
238 ASSERT_NOT_REACHED();
239 }
240 return false;
241 }
242
227 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing WindowSizeOverride) 243 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing WindowSizeOverride)
228 { 244 {
229 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) 245 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride)
230 return; 246 return;
231 247
232 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; 248 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride;
233 m_page->setNeedsRecalcStyleInAllFrames(); 249 m_page->setNeedsRecalcStyleInAllFrames();
234 } 250 }
235 251
252 void Settings::setTextAutosizingEnabledOverride(TextAutosizingOverride textAutos izingOverride)
pfeldman 2013/10/16 05:34:14 Instead of introducing a new setting clients might
pdr. 2013/10/18 01:28:44 Great catch, done.
253 {
254 if (m_textAutosizingOverride == textAutosizingOverride)
255 return;
256
257 m_textAutosizingOverride = textAutosizingOverride;
258 m_page->setNeedsRecalcStyleInAllFrames();
259 }
260
236 void Settings::setUseWideViewport(bool useWideViewport) 261 void Settings::setUseWideViewport(bool useWideViewport)
237 { 262 {
238 if (m_useWideViewport == useWideViewport) 263 if (m_useWideViewport == useWideViewport)
239 return; 264 return;
240 265
241 m_useWideViewport = useWideViewport; 266 m_useWideViewport = useWideViewport;
242 if (m_page->mainFrame()) 267 if (m_page->mainFrame())
243 m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame() ->document()->viewportDescription()); 268 m_page->chrome().dispatchViewportPropertiesDidChange(m_page->mainFrame() ->document()->viewportDescription());
244 } 269 }
245 270
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 { 406 {
382 if (m_viewportEnabled == enabled) 407 if (m_viewportEnabled == enabled)
383 return; 408 return;
384 409
385 m_viewportEnabled = enabled; 410 m_viewportEnabled = enabled;
386 if (m_page->mainFrame()) 411 if (m_page->mainFrame())
387 m_page->mainFrame()->document()->updateViewportDescription(); 412 m_page->mainFrame()->document()->updateViewportDescription();
388 } 413 }
389 414
390 } // namespace WebCore 415 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698