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

Unified Diff: Source/core/frame/Screen.cpp

Issue 1109213002: Make createWindow (mostly) work with OOPIF (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix style, use FrameView::root Created 5 years, 8 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
Index: Source/core/frame/Screen.cpp
diff --git a/Source/core/frame/Screen.cpp b/Source/core/frame/Screen.cpp
index cd743bc7e9223f14bf899b3ec85489ffd5f906c9..40bb5885b2edb7611a16ce324f65c917d297d2ad 100644
--- a/Source/core/frame/Screen.cpp
+++ b/Source/core/frame/Screen.cpp
@@ -35,6 +35,7 @@
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/inspector/InspectorInstrumentation.h"
+#include "core/page/Chrome.h"
#include "platform/PlatformScreen.h"
namespace blink {
@@ -83,9 +84,11 @@ int Screen::availLeft() const
if (!m_frame)
return 0;
FrameHost* host = m_frame->host();
- if (host && host->settings().reportScreenSizeInPhysicalPixelsQuirk())
- return lroundf(screenAvailableRect(m_frame->view()).x() * host->deviceScaleFactor());
- return static_cast<int>(screenAvailableRect(m_frame->view()).x());
+ if (!host)
+ return 0;
+ if (host->settings().reportScreenSizeInPhysicalPixelsQuirk())
+ return lroundf(screenAvailableRect(host->chrome()).x() * host->deviceScaleFactor());
+ return static_cast<int>(screenAvailableRect(host->chrome()).x());
}
int Screen::availTop() const
@@ -93,9 +96,11 @@ int Screen::availTop() const
if (!m_frame)
return 0;
FrameHost* host = m_frame->host();
- if (host && host->settings().reportScreenSizeInPhysicalPixelsQuirk())
- return lroundf(screenAvailableRect(m_frame->view()).y() * host->deviceScaleFactor());
- return static_cast<int>(screenAvailableRect(m_frame->view()).y());
+ if (!host)
+ return 0;
+ if (host->settings().reportScreenSizeInPhysicalPixelsQuirk())
+ return lroundf(screenAvailableRect(host->chrome()).y() * host->deviceScaleFactor());
+ return static_cast<int>(screenAvailableRect(host->chrome()).y());
}
unsigned Screen::availHeight() const
@@ -103,9 +108,11 @@ unsigned Screen::availHeight() const
if (!m_frame)
return 0;
FrameHost* host = m_frame->host();
- if (host && host->settings().reportScreenSizeInPhysicalPixelsQuirk())
- return lroundf(screenAvailableRect(m_frame->view()).height() * host->deviceScaleFactor());
- return static_cast<unsigned>(screenAvailableRect(m_frame->view()).height());
+ if (!host)
+ return 0;
+ if (host->settings().reportScreenSizeInPhysicalPixelsQuirk())
+ return lroundf(screenAvailableRect(host->chrome()).height() * host->deviceScaleFactor());
+ return static_cast<unsigned>(screenAvailableRect(host->chrome()).height());
}
unsigned Screen::availWidth() const
@@ -113,9 +120,11 @@ unsigned Screen::availWidth() const
if (!m_frame)
return 0;
FrameHost* host = m_frame->host();
- if (host && host->settings().reportScreenSizeInPhysicalPixelsQuirk())
- return lroundf(screenAvailableRect(m_frame->view()).width() * host->deviceScaleFactor());
- return static_cast<unsigned>(screenAvailableRect(m_frame->view()).width());
+ if (!host)
+ return 0;
+ if (host->settings().reportScreenSizeInPhysicalPixelsQuirk())
+ return lroundf(screenAvailableRect(host->chrome()).width() * host->deviceScaleFactor());
+ return static_cast<unsigned>(screenAvailableRect(host->chrome()).width());
}
DEFINE_TRACE(Screen)

Powered by Google App Engine
This is Rietveld 408576698