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

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

Issue 870933002: Make it possible to set the display mode from the WebView API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Using enum now 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 108 WebDisplayMode MediaValues::calculateDisplayMode(LocalFrame* frame) const
109 { 109 {
110 ASSERT(frame); 110 ASSERT(frame);
111 DisplayMode mode = frame->host()->settings().displayModeOverride(); 111 WebDisplayMode mode = frame->host()->settings().displayModeOverride();
112 112
113 if (mode != DisplayModeUndefined) 113 if (mode != WebDisplayModeUndefined)
114 return mode; 114 return mode;
115 115
116 return DisplayModeBrowser; 116 if (!frame->view())
117 return WebDisplayModeBrowser;
118
119 return frame->view()->displayMode();
117 } 120 }
118 121
119 bool MediaValues::calculateThreeDEnabled(LocalFrame* frame) const 122 bool MediaValues::calculateThreeDEnabled(LocalFrame* frame) const
120 { 123 {
121 ASSERT(frame && frame->contentRenderer() && frame->contentRenderer()->compos itor()); 124 ASSERT(frame && frame->contentRenderer() && frame->contentRenderer()->compos itor());
122 bool threeDEnabled = false; 125 bool threeDEnabled = false;
123 if (RenderView* view = frame->contentRenderer()) 126 if (RenderView* view = frame->contentRenderer())
124 threeDEnabled = view->compositor()->hasAcceleratedCompositing(); 127 threeDEnabled = view->compositor()->hasAcceleratedCompositing();
125 return threeDEnabled; 128 return threeDEnabled;
126 } 129 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 216 }
214 217
215 LocalFrame* MediaValues::frameFrom(Document& document) 218 LocalFrame* MediaValues::frameFrom(Document& document)
216 { 219 {
217 Document* executingDocument = document.importsController() ? document.import sController()->master() : &document; 220 Document* executingDocument = document.importsController() ? document.import sController()->master() : &document;
218 ASSERT(executingDocument); 221 ASSERT(executingDocument);
219 return executingDocument->frame(); 222 return executingDocument->frame();
220 } 223 }
221 224
222 } // namespace 225 } // 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