| Index: third_party/WebKit/Source/core/frame/Screen.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/Screen.cpp b/third_party/WebKit/Source/core/frame/Screen.cpp
|
| index 0abf20f12bc9a2989905bd7a37f6a4ae9d053609..530c0bb44ac860781fd7645e0aaeeda5ced69e12 100644
|
| --- a/third_party/WebKit/Source/core/frame/Screen.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/Screen.cpp
|
| @@ -34,6 +34,7 @@
|
| #include "core/frame/Settings.h"
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| #include "core/page/ChromeClient.h"
|
| +#include "core/page/Page.h"
|
| #include "public/platform/WebScreenInfo.h"
|
|
|
| namespace blink {
|
| @@ -43,27 +44,27 @@ Screen::Screen(LocalFrame* frame) : DOMWindowClient(frame) {}
|
| int Screen::height() const {
|
| if (!frame())
|
| return 0;
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| + Page* page = frame()->page();
|
| + if (!page)
|
| return 0;
|
| - if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| - WebScreenInfo screenInfo = host->chromeClient().screenInfo();
|
| + if (page->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| + WebScreenInfo screenInfo = page->chromeClient().screenInfo();
|
| return lroundf(screenInfo.rect.height * screenInfo.deviceScaleFactor);
|
| }
|
| - return host->chromeClient().screenInfo().rect.height;
|
| + return page->chromeClient().screenInfo().rect.height;
|
| }
|
|
|
| int Screen::width() const {
|
| if (!frame())
|
| return 0;
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| + Page* page = frame()->page();
|
| + if (!page)
|
| return 0;
|
| - if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| - WebScreenInfo screenInfo = host->chromeClient().screenInfo();
|
| + if (page->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| + WebScreenInfo screenInfo = page->chromeClient().screenInfo();
|
| return lroundf(screenInfo.rect.width * screenInfo.deviceScaleFactor);
|
| }
|
| - return host->chromeClient().screenInfo().rect.width;
|
| + return page->chromeClient().screenInfo().rect.width;
|
| }
|
|
|
| unsigned Screen::colorDepth() const {
|
| @@ -83,55 +84,55 @@ unsigned Screen::pixelDepth() const {
|
| int Screen::availLeft() const {
|
| if (!frame())
|
| return 0;
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| + Page* page = frame()->page();
|
| + if (!page)
|
| return 0;
|
| - if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| - WebScreenInfo screenInfo = host->chromeClient().screenInfo();
|
| + if (page->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| + WebScreenInfo screenInfo = page->chromeClient().screenInfo();
|
| return lroundf(screenInfo.availableRect.x * screenInfo.deviceScaleFactor);
|
| }
|
| - return static_cast<int>(host->chromeClient().screenInfo().availableRect.x);
|
| + return static_cast<int>(page->chromeClient().screenInfo().availableRect.x);
|
| }
|
|
|
| int Screen::availTop() const {
|
| if (!frame())
|
| return 0;
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| + Page* page = frame()->page();
|
| + if (!page)
|
| return 0;
|
| - if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| - WebScreenInfo screenInfo = host->chromeClient().screenInfo();
|
| + if (page->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| + WebScreenInfo screenInfo = page->chromeClient().screenInfo();
|
| return lroundf(screenInfo.availableRect.y * screenInfo.deviceScaleFactor);
|
| }
|
| - return static_cast<int>(host->chromeClient().screenInfo().availableRect.y);
|
| + return static_cast<int>(page->chromeClient().screenInfo().availableRect.y);
|
| }
|
|
|
| int Screen::availHeight() const {
|
| if (!frame())
|
| return 0;
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| + Page* page = frame()->page();
|
| + if (!page)
|
| return 0;
|
| - if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| - WebScreenInfo screenInfo = host->chromeClient().screenInfo();
|
| + if (page->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| + WebScreenInfo screenInfo = page->chromeClient().screenInfo();
|
| return lroundf(screenInfo.availableRect.height *
|
| screenInfo.deviceScaleFactor);
|
| }
|
| - return host->chromeClient().screenInfo().availableRect.height;
|
| + return page->chromeClient().screenInfo().availableRect.height;
|
| }
|
|
|
| int Screen::availWidth() const {
|
| if (!frame())
|
| return 0;
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| + Page* page = frame()->page();
|
| + if (!page)
|
| return 0;
|
| - if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| - WebScreenInfo screenInfo = host->chromeClient().screenInfo();
|
| + if (page->settings().getReportScreenSizeInPhysicalPixelsQuirk()) {
|
| + WebScreenInfo screenInfo = page->chromeClient().screenInfo();
|
| return lroundf(screenInfo.availableRect.width *
|
| screenInfo.deviceScaleFactor);
|
| }
|
| - return host->chromeClient().screenInfo().availableRect.width;
|
| + return page->chromeClient().screenInfo().availableRect.width;
|
| }
|
|
|
| DEFINE_TRACE(Screen) {
|
|
|