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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // fullscreen by passing through the full size in willUseFullScreenContentSize. | 184 // fullscreen by passing through the full size in willUseFullScreenContentSize. |
185 - (NSSize)window:(NSWindow *)window | 185 - (NSSize)window:(NSWindow *)window |
186 willUseFullScreenContentSize:(NSSize)proposedSize { | 186 willUseFullScreenContentSize:(NSSize)proposedSize { |
187 return proposedSize; | 187 return proposedSize; |
188 } | 188 } |
189 | 189 |
190 - (void)executeCommand:(int)command { | 190 - (void)executeCommand:(int)command { |
191 // No-op, swallow the event. | 191 // No-op, swallow the event. |
192 } | 192 } |
193 | 193 |
194 - (BOOL)handledByExtensionCommand:(NSEvent*)event { | 194 - (BOOL)handledByExtensionCommand:(NSEvent*)event |
| 195 priority:(ui::AcceleratorManager::HandlerPriority)priority { |
195 if (appWindow_) | 196 if (appWindow_) |
196 return appWindow_->HandledByExtensionCommand(event); | 197 return appWindow_->HandledByExtensionCommand(event, priority); |
197 return NO; | 198 return NO; |
198 } | 199 } |
199 | 200 |
200 @end | 201 @end |
201 | 202 |
202 // This is really a method on NSGrayFrame, so it should only be called on the | 203 // This is really a method on NSGrayFrame, so it should only be called on the |
203 // view passed into -[NSWindow drawCustomFrameRect:forView:]. | 204 // view passed into -[NSWindow drawCustomFrameRect:forView:]. |
204 @interface NSView (PrivateMethods) | 205 @interface NSView (PrivateMethods) |
205 - (CGFloat)roundedCornerRadius; | 206 - (CGFloat)roundedCornerRadius; |
206 @end | 207 @end |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 } | 906 } |
906 | 907 |
907 void NativeAppWindowCocoa::WindowWillZoom() { | 908 void NativeAppWindowCocoa::WindowWillZoom() { |
908 // See top of file NOTE: Maximize and Zoom. | 909 // See top of file NOTE: Maximize and Zoom. |
909 if (IsMaximized()) | 910 if (IsMaximized()) |
910 Restore(); | 911 Restore(); |
911 else | 912 else |
912 Maximize(); | 913 Maximize(); |
913 } | 914 } |
914 | 915 |
915 bool NativeAppWindowCocoa::HandledByExtensionCommand(NSEvent* event) { | 916 bool NativeAppWindowCocoa::HandledByExtensionCommand( |
| 917 NSEvent* event, |
| 918 ui::AcceleratorManager::HandlerPriority priority) { |
916 return extension_keybinding_registry_->ProcessKeyEvent( | 919 return extension_keybinding_registry_->ProcessKeyEvent( |
917 content::NativeWebKeyboardEvent(event)); | 920 content::NativeWebKeyboardEvent(event), priority); |
918 } | 921 } |
919 | 922 |
920 void NativeAppWindowCocoa::ShowWithApp() { | 923 void NativeAppWindowCocoa::ShowWithApp() { |
921 is_hidden_with_app_ = false; | 924 is_hidden_with_app_ = false; |
922 if (!app_window_->is_hidden()) | 925 if (!app_window_->is_hidden()) |
923 ShowInactive(); | 926 ShowInactive(); |
924 } | 927 } |
925 | 928 |
926 void NativeAppWindowCocoa::HideWithApp() { | 929 void NativeAppWindowCocoa::HideWithApp() { |
927 is_hidden_with_app_ = true; | 930 is_hidden_with_app_ = true; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 } | 1004 } |
1002 | 1005 |
1003 void NativeAppWindowCocoa::UpdateRestoredBounds() { | 1006 void NativeAppWindowCocoa::UpdateRestoredBounds() { |
1004 if (IsRestored(*this)) | 1007 if (IsRestored(*this)) |
1005 restored_bounds_ = [window() frame]; | 1008 restored_bounds_ = [window() frame]; |
1006 } | 1009 } |
1007 | 1010 |
1008 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { | 1011 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { |
1009 [window() orderOut:window_controller_]; | 1012 [window() orderOut:window_controller_]; |
1010 } | 1013 } |
OLD | NEW |