| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 @interface NSView (PrivateMethods) | 204 @interface NSView (PrivateMethods) |
| 205 - (CGFloat)roundedCornerRadius; | 205 - (CGFloat)roundedCornerRadius; |
| 206 @end | 206 @end |
| 207 | 207 |
| 208 // TODO(jamescook): Should these be AppNSWindow to match apps::AppWindow? | 208 // TODO(jamescook): Should these be AppNSWindow to match apps::AppWindow? |
| 209 // http://crbug.com/344082 | 209 // http://crbug.com/344082 |
| 210 @interface ShellNSWindow : ChromeEventProcessingWindow | 210 @interface ShellNSWindow : ChromeEventProcessingWindow |
| 211 @end | 211 @end |
| 212 @implementation ShellNSWindow | 212 @implementation ShellNSWindow |
| 213 | 213 |
| 214 - (instancetype)initWithContentRect:(NSRect)contentRect |
| 215 styleMask:(NSUInteger)windowStyle |
| 216 backing:(NSBackingStoreType)bufferingType |
| 217 defer:(BOOL)deferCreation { |
| 218 if ((self = [super initWithContentRect:contentRect |
| 219 styleMask:windowStyle |
| 220 backing:bufferingType |
| 221 defer:deferCreation])) { |
| 222 if ([self respondsToSelector:@selector(setTitleVisibility:)]) |
| 223 self.titleVisibility = NSWindowTitleHidden; |
| 224 } |
| 225 |
| 226 return self; |
| 227 } |
| 228 |
| 214 // Similar to ChromeBrowserWindow, don't draw the title, but allow it to be seen | 229 // Similar to ChromeBrowserWindow, don't draw the title, but allow it to be seen |
| 215 // in menus, Expose, etc. | 230 // in menus, Expose, etc. |
| 216 - (BOOL)_isTitleHidden { | 231 - (BOOL)_isTitleHidden { |
| 217 return YES; | 232 // Only intervene with 10.6-10.9. |
| 233 if ([self respondsToSelector:@selector(setTitleVisibility:)]) |
| 234 return [super _isTitleHidden]; |
| 235 else |
| 236 return YES; |
| 218 } | 237 } |
| 219 | 238 |
| 220 @end | 239 @end |
| 221 | 240 |
| 222 @interface ShellCustomFrameNSWindow : ShellNSWindow { | 241 @interface ShellCustomFrameNSWindow : ShellNSWindow { |
| 223 @private | 242 @private |
| 224 base::scoped_nsobject<NSColor> color_; | 243 base::scoped_nsobject<NSColor> color_; |
| 225 base::scoped_nsobject<NSColor> inactiveColor_; | 244 base::scoped_nsobject<NSColor> inactiveColor_; |
| 226 } | 245 } |
| 227 | 246 |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 } | 982 } |
| 964 | 983 |
| 965 void NativeAppWindowCocoa::UpdateRestoredBounds() { | 984 void NativeAppWindowCocoa::UpdateRestoredBounds() { |
| 966 if (IsRestored(*this)) | 985 if (IsRestored(*this)) |
| 967 restored_bounds_ = [window() frame]; | 986 restored_bounds_ = [window() frame]; |
| 968 } | 987 } |
| 969 | 988 |
| 970 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { | 989 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { |
| 971 [window() orderOut:window_controller_]; | 990 [window() orderOut:window_controller_]; |
| 972 } | 991 } |
| OLD | NEW |