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

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

Issue 853483003: Add support for 'display-mode' MQ defined in Manifest spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 11 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/css/MediaValues.h ('k') | Source/core/css/MediaValuesCached.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 // 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 "config.h" 5 #include "config.h"
6 #include "core/css/MediaValues.h" 6 #include "core/css/MediaValues.h"
7 7
8 #include "core/css/CSSHelper.h" 8 #include "core/css/CSSHelper.h"
9 #include "core/css/MediaValuesCached.h" 9 #include "core/css/MediaValuesCached.h"
10 #include "core/css/MediaValuesDynamic.h" 10 #include "core/css/MediaValuesDynamic.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 const String MediaValues::calculateMediaType(LocalFrame* frame) const 100 const String MediaValues::calculateMediaType(LocalFrame* frame) const
101 { 101 {
102 ASSERT(frame); 102 ASSERT(frame);
103 if (!frame->view()) 103 if (!frame->view())
104 return emptyAtom; 104 return emptyAtom;
105 return frame->view()->mediaType(); 105 return frame->view()->mediaType();
106 } 106 }
107 107
108 DisplayMode MediaValues::calculateDisplayMode(LocalFrame* frame) const
109 {
110 ASSERT(frame);
111 DisplayMode mode = frame->host()->settings().displayModeOverride();
112
113 if (mode != DisplayModeUndefined)
114 return mode;
115
116 return DisplayModeBrowser;
117 }
118
108 bool MediaValues::calculateThreeDEnabled(LocalFrame* frame) const 119 bool MediaValues::calculateThreeDEnabled(LocalFrame* frame) const
109 { 120 {
110 ASSERT(frame && frame->contentRenderer() && frame->contentRenderer()->compos itor()); 121 ASSERT(frame && frame->contentRenderer() && frame->contentRenderer()->compos itor());
111 bool threeDEnabled = false; 122 bool threeDEnabled = false;
112 if (RenderView* view = frame->contentRenderer()) 123 if (RenderView* view = frame->contentRenderer())
113 threeDEnabled = view->compositor()->hasAcceleratedCompositing(); 124 threeDEnabled = view->compositor()->hasAcceleratedCompositing();
114 return threeDEnabled; 125 return threeDEnabled;
115 } 126 }
116 127
117 PointerType MediaValues::calculatePrimaryPointerType(LocalFrame* frame) const 128 PointerType MediaValues::calculatePrimaryPointerType(LocalFrame* frame) const
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 213 }
203 214
204 LocalFrame* MediaValues::frameFrom(Document& document) 215 LocalFrame* MediaValues::frameFrom(Document& document)
205 { 216 {
206 Document* executingDocument = document.importsController() ? document.import sController()->master() : &document; 217 Document* executingDocument = document.importsController() ? document.import sController()->master() : &document;
207 ASSERT(executingDocument); 218 ASSERT(executingDocument);
208 return executingDocument->frame(); 219 return executingDocument->frame();
209 } 220 }
210 221
211 } // namespace 222 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaValues.h ('k') | Source/core/css/MediaValuesCached.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698