| 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/shell_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/cocoa/browser_window_utils.h" | 9 #include "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 10 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 10 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool ShellWindowCocoa::IsMinimized() const { | 63 bool ShellWindowCocoa::IsMinimized() const { |
| 64 return [window() isMiniaturized]; | 64 return [window() isMiniaturized]; |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool ShellWindowCocoa::IsFullscreen() const { | 67 bool ShellWindowCocoa::IsFullscreen() const { |
| 68 return false; | 68 return false; |
| 69 } | 69 } |
| 70 | 70 |
| 71 gfx::NativeWindow ShellWindowCocoa::GetNativeWindow() { |
| 72 return window(); |
| 73 } |
| 74 |
| 71 gfx::Rect ShellWindowCocoa::GetRestoredBounds() const { | 75 gfx::Rect ShellWindowCocoa::GetRestoredBounds() const { |
| 72 // Flip coordinates based on the primary screen. | 76 // Flip coordinates based on the primary screen. |
| 73 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 77 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
| 74 NSRect frame = [window() frame]; | 78 NSRect frame = [window() frame]; |
| 75 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); | 79 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); |
| 76 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); | 80 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); |
| 77 return bounds; | 81 return bounds; |
| 78 } | 82 } |
| 79 | 83 |
| 80 gfx::Rect ShellWindowCocoa::GetBounds() const { | 84 gfx::Rect ShellWindowCocoa::GetBounds() const { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 return [window_controller_ window]; | 173 return [window_controller_ window]; |
| 170 } | 174 } |
| 171 | 175 |
| 172 // static | 176 // static |
| 173 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 177 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
| 174 const extensions::Extension* extension, | 178 const extensions::Extension* extension, |
| 175 const GURL& url, | 179 const GURL& url, |
| 176 const ShellWindow::CreateParams params) { | 180 const ShellWindow::CreateParams params) { |
| 177 return new ShellWindowCocoa(profile, extension, url, params); | 181 return new ShellWindowCocoa(profile, extension, url, params); |
| 178 } | 182 } |
| OLD | NEW |