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

Side by Side Diff: third_party/WebKit/Source/core/css/MediaValues.cpp

Issue 2709263003: Removed FrameHost::settings() (Closed)
Patch Set: Switched if statement to use page Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/Frame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/MediaValues.h" 5 #include "core/css/MediaValues.h"
6 6
7 #include "core/css/CSSHelper.h" 7 #include "core/css/CSSHelper.h"
8 #include "core/css/MediaValuesCached.h" 8 #include "core/css/MediaValuesCached.h"
9 #include "core/css/MediaValuesDynamic.h" 9 #include "core/css/MediaValuesDynamic.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 int MediaValues::calculateMonochromeBitsPerComponent(LocalFrame* frame) { 83 int MediaValues::calculateMonochromeBitsPerComponent(LocalFrame* frame) {
84 ASSERT(frame && frame->page() && frame->page()->mainFrame()); 84 ASSERT(frame && frame->page() && frame->page()->mainFrame());
85 if (!frame->page()->mainFrame()->isLocalFrame() || 85 if (!frame->page()->mainFrame()->isLocalFrame() ||
86 !frame->host()->chromeClient().screenInfo().isMonochrome) 86 !frame->host()->chromeClient().screenInfo().isMonochrome)
87 return 0; 87 return 0;
88 return frame->host()->chromeClient().screenInfo().depthPerComponent; 88 return frame->host()->chromeClient().screenInfo().depthPerComponent;
89 } 89 }
90 90
91 int MediaValues::calculateDefaultFontSize(LocalFrame* frame) { 91 int MediaValues::calculateDefaultFontSize(LocalFrame* frame) {
92 return frame->host()->settings().getDefaultFontSize(); 92 return frame->page()->settings().getDefaultFontSize();
93 } 93 }
94 94
95 const String MediaValues::calculateMediaType(LocalFrame* frame) { 95 const String MediaValues::calculateMediaType(LocalFrame* frame) {
96 ASSERT(frame); 96 ASSERT(frame);
97 if (!frame->view()) 97 if (!frame->view())
98 return emptyAtom; 98 return emptyAtom;
99 return frame->view()->mediaType(); 99 return frame->view()->mediaType();
100 } 100 }
101 101
102 WebDisplayMode MediaValues::calculateDisplayMode(LocalFrame* frame) { 102 WebDisplayMode MediaValues::calculateDisplayMode(LocalFrame* frame) {
103 ASSERT(frame); 103 ASSERT(frame);
104 WebDisplayMode mode = frame->host()->settings().getDisplayModeOverride(); 104 WebDisplayMode mode = frame->page()->settings().getDisplayModeOverride();
105 105
106 if (mode != WebDisplayModeUndefined) 106 if (mode != WebDisplayModeUndefined)
107 return mode; 107 return mode;
108 108
109 if (!frame->view()) 109 if (!frame->view())
110 return WebDisplayModeBrowser; 110 return WebDisplayModeBrowser;
111 111
112 return frame->view()->displayMode(); 112 return frame->view()->displayMode();
113 } 113 }
114 114
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 LocalFrame* MediaValues::frameFrom(Document& document) { 218 LocalFrame* MediaValues::frameFrom(Document& document) {
219 Document* executingDocument = document.importsController() 219 Document* executingDocument = document.importsController()
220 ? document.importsController()->master() 220 ? document.importsController()->master()
221 : &document; 221 : &document;
222 ASSERT(executingDocument); 222 ASSERT(executingDocument);
223 return executingDocument->frame(); 223 return executingDocument->frame();
224 } 224 }
225 225
226 } // namespace blink 226 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698