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

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

Issue 2709263003: Removed FrameHost::settings() (Closed)
Patch Set: Switched if statement to use page Created 3 years, 10 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: 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) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | third_party/WebKit/Source/core/frame/VisualViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698