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

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 2317563004: Change blink::WebScreenInfo to content::ScreenInfo (Closed)
Patch Set: Fix Windows compile Created 4 years, 3 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: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 9ba342ad60d058d63364e8ea259da5c5641e9c10..f553ce963e6ee08b268a63f9266f4122ce04edb2 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -40,6 +40,7 @@
using content::RenderViewHostFactory;
using content::RenderWidgetHostView;
using content::RenderWidgetHostViewMac;
+using content::ScreenInfo;
using content::WebContents;
using content::WebContentsImpl;
using content::WebContentsViewMac;
@@ -77,23 +78,23 @@ - (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
namespace {
-blink::WebScreenInfo GetWebScreenInfo(NSView* view) {
+content::ScreenInfo GetNSViewScreenInfo(NSView* view) {
display::Display display =
display::Screen::GetScreen()->GetDisplayNearestWindow(view);
NSScreen* screen = [NSScreen deepestScreen];
- blink::WebScreenInfo results;
+ content::ScreenInfo results;
- results.deviceScaleFactor = static_cast<int>(display.device_scale_factor());
+ results.device_scale_factor = static_cast<int>(display.device_scale_factor());
results.depth = NSBitsPerPixelFromDepth([screen depth]);
- results.depthPerComponent = NSBitsPerSampleFromDepth([screen depth]);
- results.isMonochrome =
+ results.depth_per_component = NSBitsPerSampleFromDepth([screen depth]);
+ results.is_monochrome =
[[screen colorSpace] colorSpaceModel] == NSGrayColorSpaceModel;
results.rect = display.bounds();
- results.availableRect = display.work_area();
- results.orientationAngle = display.RotationAsDegree();
- results.orientationType =
+ results.available_rect = display.work_area();
+ results.orientation_angle = display.RotationAsDegree();
+ results.orientation_type =
content::RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display);
return results;
@@ -104,9 +105,8 @@ - (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
namespace content {
// static
-void WebContentsView::GetDefaultScreenInfo(
- blink::WebScreenInfo* results) {
- *results = GetWebScreenInfo(NULL);
+void WebContentsView::GetDefaultScreenInfo(ScreenInfo* results) {
+ *results = GetNSViewScreenInfo(nil);
}
WebContentsView* CreateWebContentsView(
@@ -150,8 +150,8 @@ - (void)viewDidBecomeFirstResponder:(NSNotification*)notification;
return window ? window : delegate_->GetNativeWindow();
}
-void WebContentsViewMac::GetScreenInfo(blink::WebScreenInfo* results) const {
- *results = GetWebScreenInfo(GetNativeView());
+void WebContentsViewMac::GetScreenInfo(ScreenInfo* results) const {
+ *results = GetNSViewScreenInfo(GetNativeView());
}
void WebContentsViewMac::GetContainerBounds(gfx::Rect* out) const {

Powered by Google App Engine
This is Rietveld 408576698