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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (ancestor_window && (NSWidth([enclosing_window frame]) == | 389 if (ancestor_window && (NSWidth([enclosing_window frame]) == |
390 NSWidth([ancestor_window frame]))) { | 390 NSWidth([ancestor_window frame]))) { |
391 enclosing_window = ancestor_window; | 391 enclosing_window = ancestor_window; |
392 } | 392 } |
393 | 393 |
394 return enclosing_window; | 394 return enclosing_window; |
395 } | 395 } |
396 | 396 |
397 blink::WebScreenInfo GetWebScreenInfo(NSView* view) { | 397 blink::WebScreenInfo GetWebScreenInfo(NSView* view) { |
398 gfx::Display display = | 398 gfx::Display display = |
399 gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(view); | 399 gfx::Screen::GetScreen()->GetDisplayNearestWindow(view); |
400 | 400 |
401 NSScreen* screen = [NSScreen deepestScreen]; | 401 NSScreen* screen = [NSScreen deepestScreen]; |
402 | 402 |
403 blink::WebScreenInfo results; | 403 blink::WebScreenInfo results; |
404 | 404 |
405 results.deviceScaleFactor = static_cast<int>(display.device_scale_factor()); | 405 results.deviceScaleFactor = static_cast<int>(display.device_scale_factor()); |
406 results.depth = NSBitsPerPixelFromDepth([screen depth]); | 406 results.depth = NSBitsPerPixelFromDepth([screen depth]); |
407 results.depthPerComponent = NSBitsPerSampleFromDepth([screen depth]); | 407 results.depthPerComponent = NSBitsPerSampleFromDepth([screen depth]); |
408 results.isMonochrome = | 408 results.isMonochrome = |
409 [[screen colorSpace] colorSpaceModel] == NSGrayColorSpaceModel; | 409 [[screen colorSpace] colorSpaceModel] == NSGrayColorSpaceModel; |
(...skipping 3028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3438 | 3438 |
3439 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3439 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3440 // regions that are not draggable. (See ControlRegionView in | 3440 // regions that are not draggable. (See ControlRegionView in |
3441 // native_app_window_cocoa.mm). This requires the render host view to be | 3441 // native_app_window_cocoa.mm). This requires the render host view to be |
3442 // draggable by default. | 3442 // draggable by default. |
3443 - (BOOL)mouseDownCanMoveWindow { | 3443 - (BOOL)mouseDownCanMoveWindow { |
3444 return YES; | 3444 return YES; |
3445 } | 3445 } |
3446 | 3446 |
3447 @end | 3447 @end |
OLD | NEW |