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

Side by Side Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Carbon/Carbon.h> 5 #import <Carbon/Carbon.h>
6 6
7 #import "content/browser/web_contents/web_contents_view_mac.h" 7 #import "content/browser/web_contents/web_contents_view_mac.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 - (content::WebContentsImpl*)webContents; 78 - (content::WebContentsImpl*)webContents;
79 @end 79 @end
80 80
81 namespace { 81 namespace {
82 82
83 WebContentsViewMac::RenderWidgetHostViewCreateFunction 83 WebContentsViewMac::RenderWidgetHostViewCreateFunction
84 g_create_render_widget_host_view = nullptr; 84 g_create_render_widget_host_view = nullptr;
85 85
86 content::ScreenInfo GetNSViewScreenInfo(NSView* view) { 86 content::ScreenInfo GetNSViewScreenInfo(NSView* view) {
87 display::Display display = 87 display::Display display =
88 display::Screen::GetScreen()->GetDisplayNearestWindow(view); 88 display::Screen::GetScreen()->GetDisplayNearestView(view);
89 89
90 content::ScreenInfo results; 90 content::ScreenInfo results;
91 results.device_scale_factor = static_cast<int>(display.device_scale_factor()); 91 results.device_scale_factor = static_cast<int>(display.device_scale_factor());
92 results.icc_profile = display.icc_profile(); 92 results.icc_profile = display.icc_profile();
93 results.depth = display.color_depth(); 93 results.depth = display.color_depth();
94 results.depth_per_component = display.depth_per_component(); 94 results.depth_per_component = display.depth_per_component();
95 results.is_monochrome = display.is_monochrome(); 95 results.is_monochrome = display.is_monochrome();
96 results.rect = display.bounds(); 96 results.rect = display.bounds();
97 results.available_rect = display.work_area(); 97 results.available_rect = display.work_area();
98 results.orientation_angle = display.RotationAsDegree(); 98 results.orientation_angle = display.RotationAsDegree();
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 734
735 - (void)viewDidHide { 735 - (void)viewDidHide {
736 [self updateWebContentsVisibility]; 736 [self updateWebContentsVisibility];
737 } 737 }
738 738
739 - (void)viewDidUnhide { 739 - (void)viewDidUnhide {
740 [self updateWebContentsVisibility]; 740 [self updateWebContentsVisibility];
741 } 741 }
742 742
743 @end 743 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698