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

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

Issue 14813025: Refactor viewport initialization logic out of WebViewImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix webkit_unit_tests Created 7 years, 7 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 15 matching lines...) Expand all
26 #include "config.h" 26 #include "config.h"
27 #include "core/page/Settings.h" 27 #include "core/page/Settings.h"
28 28
29 #include <limits> 29 #include <limits>
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/history/BackForwardController.h" 31 #include "core/history/BackForwardController.h"
32 #include "core/history/HistoryItem.h" 32 #include "core/history/HistoryItem.h"
33 #include "core/html/HTMLMediaElement.h" 33 #include "core/html/HTMLMediaElement.h"
34 #include "core/inspector/InspectorInstrumentation.h" 34 #include "core/inspector/InspectorInstrumentation.h"
35 #include "core/loader/cache/CachedResourceLoader.h" 35 #include "core/loader/cache/CachedResourceLoader.h"
36 #include "core/page/Chrome.h"
36 #include "core/page/Frame.h" 37 #include "core/page/Frame.h"
37 #include "core/page/FrameTree.h" 38 #include "core/page/FrameTree.h"
38 #include "core/page/FrameView.h" 39 #include "core/page/FrameView.h"
39 #include "core/page/Page.h" 40 #include "core/page/Page.h"
40 #include "core/platform/network/ResourceHandle.h" 41 #include "core/platform/network/ResourceHandle.h"
41 #include "core/rendering/TextAutosizer.h" 42 #include "core/rendering/TextAutosizer.h"
42 #include "modules/webdatabase/Database.h" 43 #include "modules/webdatabase/Database.h"
43 44
44 using namespace std; 45 using namespace std;
45 46
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 Settings::Settings(Page* page) 123 Settings::Settings(Page* page)
123 : m_page(0) 124 : m_page(0)
124 , m_mediaTypeOverride("screen") 125 , m_mediaTypeOverride("screen")
125 , m_textAutosizingFontScaleFactor(1) 126 , m_textAutosizingFontScaleFactor(1)
126 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP 127 #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
127 , m_textAutosizingWindowSizeOverride(320, 480) 128 , m_textAutosizingWindowSizeOverride(320, 480)
128 , m_textAutosizingEnabled(true) 129 , m_textAutosizingEnabled(true)
129 #else 130 #else
130 , m_textAutosizingEnabled(false) 131 , m_textAutosizingEnabled(false)
131 #endif 132 #endif
133 , m_useWideViewport(true)
134 , m_loadWithOverviewMode(true)
132 SETTINGS_INITIALIZER_LIST 135 SETTINGS_INITIALIZER_LIST
133 , m_isJavaEnabled(false) 136 , m_isJavaEnabled(false)
134 , m_loadsImagesAutomatically(false) 137 , m_loadsImagesAutomatically(false)
135 , m_areImagesEnabled(true) 138 , m_areImagesEnabled(true)
136 , m_arePluginsEnabled(false) 139 , m_arePluginsEnabled(false)
137 , m_isScriptEnabled(false) 140 , m_isScriptEnabled(false)
138 , m_fontRenderingMode(0) 141 , m_fontRenderingMode(0)
139 , m_isCSSCustomFilterEnabled(false) 142 , m_isCSSCustomFilterEnabled(false)
140 , m_cssStickyPositionEnabled(true) 143 , m_cssStickyPositionEnabled(true)
141 , m_cssVariablesEnabled(false) 144 , m_cssVariablesEnabled(false)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 246
244 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing WindowSizeOverride) 247 void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizing WindowSizeOverride)
245 { 248 {
246 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) 249 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride)
247 return; 250 return;
248 251
249 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; 252 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride;
250 m_page->setNeedsRecalcStyleInAllFrames(); 253 m_page->setNeedsRecalcStyleInAllFrames();
251 } 254 }
252 255
256 void Settings::setUseWideViewport(bool useWideViewport)
257 {
258 if (m_useWideViewport == useWideViewport)
259 return;
260
261 m_useWideViewport = useWideViewport;
262 if (m_page->chrome() && m_page->mainFrame())
263 m_page->chrome()->dispatchViewportPropertiesDidChange(m_page->mainFrame( )->document()->viewportArguments());
264 }
265
266 void Settings::setLoadWithOverviewMode(bool loadWithOverviewMode)
267 {
268 if (m_loadWithOverviewMode == loadWithOverviewMode)
269 return;
270
271 m_loadWithOverviewMode = loadWithOverviewMode;
272 if (m_page->chrome() && m_page->mainFrame())
273 m_page->chrome()->dispatchViewportPropertiesDidChange(m_page->mainFrame( )->document()->viewportArguments());
274 }
275
253 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) 276 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
254 { 277 {
255 m_textAutosizingFontScaleFactor = fontScaleFactor; 278 m_textAutosizingFontScaleFactor = fontScaleFactor;
256 279
257 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res ize, or whether there is only one document per Settings instance? 280 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res ize, or whether there is only one document per Settings instance?
258 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave rseNext()) 281 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave rseNext())
259 frame->document()->textAutosizer()->recalculateMultipliers(); 282 frame->document()->textAutosizer()->recalculateMultipliers();
260 283
261 m_page->setNeedsRecalcStyleInAllFrames(); 284 m_page->setNeedsRecalcStyleInAllFrames();
262 } 285 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 m_openGLMultisamplingEnabled = flag; 403 m_openGLMultisamplingEnabled = flag;
381 m_page->multisamplingChanged(); 404 m_page->multisamplingChanged();
382 } 405 }
383 406
384 bool Settings::openGLMultisamplingEnabled() 407 bool Settings::openGLMultisamplingEnabled()
385 { 408 {
386 return m_openGLMultisamplingEnabled; 409 return m_openGLMultisamplingEnabled;
387 } 410 }
388 411
389 } // namespace WebCore 412 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698