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) |