| 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 "chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" | 10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendSolidColor, | 387 CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendSolidColor, |
| 388 kCGDisplayBlendNormal, 0.0, 0.0, 0.0, /*synchronous=*/false); | 388 kCGDisplayBlendNormal, 0.0, 0.0, 0.0, /*synchronous=*/false); |
| 389 CGReleaseDisplayFadeReservation(token); | 389 CGReleaseDisplayFadeReservation(token); |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 | 392 |
| 393 bool NativeAppWindowCocoa::IsFullscreenOrPending() const { | 393 bool NativeAppWindowCocoa::IsFullscreenOrPending() const { |
| 394 return is_fullscreen_; | 394 return is_fullscreen_; |
| 395 } | 395 } |
| 396 | 396 |
| 397 bool NativeAppWindowCocoa::IsDetached() const { |
| 398 return false; |
| 399 } |
| 400 |
| 397 gfx::NativeWindow NativeAppWindowCocoa::GetNativeWindow() { | 401 gfx::NativeWindow NativeAppWindowCocoa::GetNativeWindow() { |
| 398 return window(); | 402 return window(); |
| 399 } | 403 } |
| 400 | 404 |
| 401 gfx::Rect NativeAppWindowCocoa::GetRestoredBounds() const { | 405 gfx::Rect NativeAppWindowCocoa::GetRestoredBounds() const { |
| 402 // Flip coordinates based on the primary screen. | 406 // Flip coordinates based on the primary screen. |
| 403 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 407 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
| 404 NSRect frame = [window() frame]; | 408 NSRect frame = [window() frame]; |
| 405 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); | 409 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); |
| 406 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); | 410 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); | 794 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); |
| 791 return static_cast<ShellNSWindow*>(window); | 795 return static_cast<ShellNSWindow*>(window); |
| 792 } | 796 } |
| 793 | 797 |
| 794 // static | 798 // static |
| 795 NativeAppWindow* NativeAppWindow::Create( | 799 NativeAppWindow* NativeAppWindow::Create( |
| 796 ShellWindow* shell_window, | 800 ShellWindow* shell_window, |
| 797 const ShellWindow::CreateParams& params) { | 801 const ShellWindow::CreateParams& params) { |
| 798 return new NativeAppWindowCocoa(shell_window, params); | 802 return new NativeAppWindowCocoa(shell_window, params); |
| 799 } | 803 } |
| OLD | NEW |