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

Unified Diff: Source/core/css/MediaValues.cpp

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaValues.cpp
diff --git a/Source/core/css/MediaValues.cpp b/Source/core/css/MediaValues.cpp
index b0b6a80b4cba943b28d1157e8e615c0a73b28f3c..a2d5e1b63c64f345ba04cb0fd978b99c826e3904 100644
--- a/Source/core/css/MediaValues.cpp
+++ b/Source/core/css/MediaValues.cpp
@@ -76,7 +76,8 @@ float MediaValues::calculateDevicePixelRatio(LocalFrame* frame) const
int MediaValues::calculateColorBitsPerComponent(LocalFrame* frame) const
{
ASSERT(frame && frame->page() && frame->page()->mainFrame());
- if (screenIsMonochrome(frame->page()->mainFrame()->view()))
+ if (!frame->page()->mainFrame()->isLocalFrame()
+ || screenIsMonochrome(frame->page()->deprecatedLocalMainFrame()->view()))
return 0;
return screenDepthPerComponent(frame->view());
}
@@ -84,9 +85,10 @@ int MediaValues::calculateColorBitsPerComponent(LocalFrame* frame) const
int MediaValues::calculateMonochromeBitsPerComponent(LocalFrame* frame) const
{
ASSERT(frame && frame->page() && frame->page()->mainFrame());
- if (screenIsMonochrome(frame->page()->mainFrame()->view()))
- return screenDepthPerComponent(frame->view());
- return 0;
+ if (!frame->page()->mainFrame()->isLocalFrame()
+ || !screenIsMonochrome(frame->page()->deprecatedLocalMainFrame()->view()))
+ return 0;
+ return screenDepthPerComponent(frame->view());
}
int MediaValues::calculateDefaultFontSize(LocalFrame* frame) const
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698