Chromium Code Reviews| 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: | |
| 196 (ui::AcceleratorManager::HandlerPriority)priority { | |
|
Scott Hess - ex-Googler
2014/07/15 19:20:59
Here too.
erikchen
2014/07/15 20:48:40
Done.
| |
| 195 if (appWindow_) | 197 if (appWindow_) |
| 196 return appWindow_->HandledByExtensionCommand(event); | 198 return appWindow_->HandledByExtensionCommand(event, priority); |
| 197 return NO; | 199 return NO; |
| 198 } | 200 } |
| 199 | 201 |
| 200 @end | 202 @end |
| 201 | 203 |
| 202 // This is really a method on NSGrayFrame, so it should only be called on the | 204 // This is really a method on NSGrayFrame, so it should only be called on the |
| 203 // view passed into -[NSWindow drawCustomFrameRect:forView:]. | 205 // view passed into -[NSWindow drawCustomFrameRect:forView:]. |
| 204 @interface NSView (PrivateMethods) | 206 @interface NSView (PrivateMethods) |
| 205 - (CGFloat)roundedCornerRadius; | 207 - (CGFloat)roundedCornerRadius; |
| 206 @end | 208 @end |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 905 } | 907 } |
| 906 | 908 |
| 907 void NativeAppWindowCocoa::WindowWillZoom() { | 909 void NativeAppWindowCocoa::WindowWillZoom() { |
| 908 // See top of file NOTE: Maximize and Zoom. | 910 // See top of file NOTE: Maximize and Zoom. |
| 909 if (IsMaximized()) | 911 if (IsMaximized()) |
| 910 Restore(); | 912 Restore(); |
| 911 else | 913 else |
| 912 Maximize(); | 914 Maximize(); |
| 913 } | 915 } |
| 914 | 916 |
| 915 bool NativeAppWindowCocoa::HandledByExtensionCommand(NSEvent* event) { | 917 bool NativeAppWindowCocoa::HandledByExtensionCommand( |
| 918 NSEvent* event, | |
| 919 ui::AcceleratorManager::HandlerPriority priority) { | |
| 916 return extension_keybinding_registry_->ProcessKeyEvent( | 920 return extension_keybinding_registry_->ProcessKeyEvent( |
| 917 content::NativeWebKeyboardEvent(event)); | 921 content::NativeWebKeyboardEvent(event), priority); |
| 918 } | 922 } |
| 919 | 923 |
| 920 void NativeAppWindowCocoa::ShowWithApp() { | 924 void NativeAppWindowCocoa::ShowWithApp() { |
| 921 is_hidden_with_app_ = false; | 925 is_hidden_with_app_ = false; |
| 922 if (!app_window_->is_hidden()) | 926 if (!app_window_->is_hidden()) |
| 923 ShowInactive(); | 927 ShowInactive(); |
| 924 } | 928 } |
| 925 | 929 |
| 926 void NativeAppWindowCocoa::HideWithApp() { | 930 void NativeAppWindowCocoa::HideWithApp() { |
| 927 is_hidden_with_app_ = true; | 931 is_hidden_with_app_ = true; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1001 } | 1005 } |
| 1002 | 1006 |
| 1003 void NativeAppWindowCocoa::UpdateRestoredBounds() { | 1007 void NativeAppWindowCocoa::UpdateRestoredBounds() { |
| 1004 if (IsRestored(*this)) | 1008 if (IsRestored(*this)) |
| 1005 restored_bounds_ = [window() frame]; | 1009 restored_bounds_ = [window() frame]; |
| 1006 } | 1010 } |
| 1007 | 1011 |
| 1008 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { | 1012 void NativeAppWindowCocoa::HideWithoutMarkingHidden() { |
| 1009 [window() orderOut:window_controller_]; | 1013 [window() orderOut:window_controller_]; |
| 1010 } | 1014 } |
| OLD | NEW |