| OLD | NEW |
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 - (void)viewDidBecomeFirstResponder:(NSNotification*)notification; | 75 - (void)viewDidBecomeFirstResponder:(NSNotification*)notification; |
| 76 - (content::WebContentsImpl*)webContents; | 76 - (content::WebContentsImpl*)webContents; |
| 77 @end | 77 @end |
| 78 | 78 |
| 79 namespace { | 79 namespace { |
| 80 | 80 |
| 81 content::ScreenInfo GetNSViewScreenInfo(NSView* view) { | 81 content::ScreenInfo GetNSViewScreenInfo(NSView* view) { |
| 82 display::Display display = | 82 display::Display display = |
| 83 display::Screen::GetScreen()->GetDisplayNearestWindow(view); | 83 display::Screen::GetScreen()->GetDisplayNearestWindow(view); |
| 84 | 84 |
| 85 NSScreen* screen = [NSScreen deepestScreen]; | |
| 86 | |
| 87 content::ScreenInfo results; | 85 content::ScreenInfo results; |
| 88 | 86 |
| 89 results.device_scale_factor = static_cast<int>(display.device_scale_factor()); | 87 results.device_scale_factor = static_cast<int>(display.device_scale_factor()); |
| 90 results.depth = NSBitsPerPixelFromDepth([screen depth]); | 88 results.depth = display.color_depth(); |
| 91 results.depth_per_component = NSBitsPerSampleFromDepth([screen depth]); | 89 results.depth_per_component = display.depth_per_component(); |
| 92 results.is_monochrome = | 90 results.is_monochrome = |
| 93 [[screen colorSpace] colorSpaceModel] == NSGrayColorSpaceModel; | 91 display.color_depth() == display.depth_per_component(); |
| 92 results.icc_profile = display.icc_profile(); |
| 94 results.rect = display.bounds(); | 93 results.rect = display.bounds(); |
| 95 results.available_rect = display.work_area(); | 94 results.available_rect = display.work_area(); |
| 96 results.orientation_angle = display.RotationAsDegree(); | 95 results.orientation_angle = display.RotationAsDegree(); |
| 97 results.orientation_type = | 96 results.orientation_type = |
| 98 content::RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display); | 97 content::RenderWidgetHostViewBase::GetOrientationTypeForDesktop(display); |
| 99 | 98 |
| 100 return results; | 99 return results; |
| 101 } | 100 } |
| 102 | 101 |
| 103 } // namespace | 102 } // namespace |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 713 |
| 715 - (void)viewDidHide { | 714 - (void)viewDidHide { |
| 716 [self updateWebContentsVisibility]; | 715 [self updateWebContentsVisibility]; |
| 717 } | 716 } |
| 718 | 717 |
| 719 - (void)viewDidUnhide { | 718 - (void)viewDidUnhide { |
| 720 [self updateWebContentsVisibility]; | 719 [self updateWebContentsVisibility]; |
| 721 } | 720 } |
| 722 | 721 |
| 723 @end | 722 @end |
| OLD | NEW |