OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/native_app_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h" |
6 | 6 |
7 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // | 39 // |
40 // Attempting maximize and restore functionality with non resizable windows | 40 // Attempting maximize and restore functionality with non resizable windows |
41 // using the native zoom method did not work, even with | 41 // using the native zoom method did not work, even with |
42 // windowWillUseStandardFrame, as the window would not restore back to the | 42 // windowWillUseStandardFrame, as the window would not restore back to the |
43 // desired size. | 43 // desired size. |
44 | 44 |
45 using apps::AppWindow; | 45 using apps::AppWindow; |
46 | 46 |
47 @interface NSWindow (NSPrivateApis) | 47 @interface NSWindow (NSPrivateApis) |
48 - (void)setBottomCornerRounded:(BOOL)rounded; | 48 - (void)setBottomCornerRounded:(BOOL)rounded; |
| 49 - (BOOL)_isTitleHidden; |
49 @end | 50 @end |
50 | 51 |
51 // Replicate specific 10.7 SDK declarations for building with prior SDKs. | 52 // Replicate specific 10.7 SDK declarations for building with prior SDKs. |
52 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 53 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
53 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 54 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
54 | 55 |
55 @interface NSWindow (LionSDKDeclarations) | 56 @interface NSWindow (LionSDKDeclarations) |
56 - (void)toggleFullScreen:(id)sender; | 57 - (void)toggleFullScreen:(id)sender; |
57 @end | 58 @end |
58 | 59 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // view passed into -[NSWindow drawCustomFrameRect:forView:]. | 217 // view passed into -[NSWindow drawCustomFrameRect:forView:]. |
217 @interface NSView (PrivateMethods) | 218 @interface NSView (PrivateMethods) |
218 - (CGFloat)roundedCornerRadius; | 219 - (CGFloat)roundedCornerRadius; |
219 @end | 220 @end |
220 | 221 |
221 // TODO(jamescook): Should these be AppNSWindow to match apps::AppWindow? | 222 // TODO(jamescook): Should these be AppNSWindow to match apps::AppWindow? |
222 // http://crbug.com/344082 | 223 // http://crbug.com/344082 |
223 @interface ShellNSWindow : ChromeEventProcessingWindow | 224 @interface ShellNSWindow : ChromeEventProcessingWindow |
224 @end | 225 @end |
225 @implementation ShellNSWindow | 226 @implementation ShellNSWindow |
| 227 |
| 228 // Similar to ChromeBrowserWindow, don't draw the title, but allow it to be seen |
| 229 // in menus, Expose, etc. |
| 230 - (BOOL)_isTitleHidden { |
| 231 return YES; |
| 232 } |
| 233 |
226 @end | 234 @end |
227 | 235 |
228 @interface ShellCustomFrameNSWindow : ShellNSWindow { | 236 @interface ShellCustomFrameNSWindow : ShellNSWindow { |
229 @private | 237 @private |
230 base::scoped_nsobject<NSColor> color_; | 238 base::scoped_nsobject<NSColor> color_; |
231 base::scoped_nsobject<NSColor> inactiveColor_; | 239 base::scoped_nsobject<NSColor> inactiveColor_; |
232 } | 240 } |
233 | 241 |
234 - (void)setColor:(NSColor*)color | 242 - (void)setColor:(NSColor*)color |
235 inactiveColor:(NSColor*)inactiveColor; | 243 inactiveColor:(NSColor*)inactiveColor; |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 } | 977 } |
970 | 978 |
971 void NativeAppWindowCocoa::UpdateRestoredBounds() { | 979 void NativeAppWindowCocoa::UpdateRestoredBounds() { |
972 if (IsRestored(*this)) | 980 if (IsRestored(*this)) |
973 restored_bounds_ = [window() frame]; | 981 restored_bounds_ = [window() frame]; |
974 } | 982 } |
975 | 983 |
976 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { | 984 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { |
977 [window() orderOut:window_controller_]; | 985 [window() orderOut:window_controller_]; |
978 } | 986 } |
OLD | NEW |