| 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/panels/panel_window_controller_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_window_controller_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 - (void)executeCommand:(int)command { | 684 - (void)executeCommand:(int)command { |
| 685 windowShim_->browser()->ExecuteCommandIfEnabled(command); | 685 windowShim_->browser()->ExecuteCommandIfEnabled(command); |
| 686 } | 686 } |
| 687 | 687 |
| 688 // Handler for the custom Close button. | 688 // Handler for the custom Close button. |
| 689 - (void)closePanel { | 689 - (void)closePanel { |
| 690 windowShim_->panel()->Close(); | 690 windowShim_->panel()->Close(); |
| 691 } | 691 } |
| 692 | 692 |
| 693 // Handler for the custom Minimize button. | 693 // Handler for the custom Minimize button. |
| 694 - (void)minimizePanel:(int)modifierFlags { | 694 - (void)minimizeButtonClicked:(int)modifierFlags { |
| 695 Panel* panel = windowShim_->panel(); | 695 Panel* panel = windowShim_->panel(); |
| 696 panel->Minimize(); | 696 panel->OnMinimizeButtonClicked((modifierFlags & NSShiftKeyMask) ? |
| 697 panel::APPLY_TO_ALL : panel::NO_MODIFIER); |
| 697 } | 698 } |
| 698 | 699 |
| 699 // Handler for the custom Restore button. | 700 // Handler for the custom Restore button. |
| 700 - (void)restorePanel:(int)modifierFlags { | 701 - (void)restoreButtonClicked:(int)modifierFlags { |
| 701 Panel* panel = windowShim_->panel(); | 702 Panel* panel = windowShim_->panel(); |
| 702 panel->Restore(); | 703 panel->OnRestoreButtonClicked((modifierFlags & NSShiftKeyMask) ? |
| 704 panel::APPLY_TO_ALL : panel::NO_MODIFIER); |
| 703 } | 705 } |
| 704 | 706 |
| 705 // Called when the user wants to close the panel or from the shutdown process. | 707 // Called when the user wants to close the panel or from the shutdown process. |
| 706 // The Browser object is in control of whether or not we're allowed to close. It | 708 // The Browser object is in control of whether or not we're allowed to close. It |
| 707 // may defer closing due to several states, such as onbeforeUnload handlers | 709 // may defer closing due to several states, such as onbeforeUnload handlers |
| 708 // needing to be fired. If closing is deferred, the Browser will handle the | 710 // needing to be fired. If closing is deferred, the Browser will handle the |
| 709 // processing required to get us to the closing state and (by watching for | 711 // processing required to get us to the closing state and (by watching for |
| 710 // all the tabs going away) will again call to close the window when it's | 712 // all the tabs going away) will again call to close the window when it's |
| 711 // finally ready. | 713 // finally ready. |
| 712 // This callback is only called if the standard Close button is enabled in XIB. | 714 // This callback is only called if the standard Close button is enabled in XIB. |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 [[self window] setLevel:NSDockWindowLevel]; | 1013 [[self window] setLevel:NSDockWindowLevel]; |
| 1012 } | 1014 } |
| 1013 | 1015 |
| 1014 - (void)enableResizeByMouse:(BOOL)enable { | 1016 - (void)enableResizeByMouse:(BOOL)enable { |
| 1015 if (![self isWindowLoaded]) | 1017 if (![self isWindowLoaded]) |
| 1016 return; | 1018 return; |
| 1017 [[self window] invalidateCursorRectsForView:overlayView_]; | 1019 [[self window] invalidateCursorRectsForView:overlayView_]; |
| 1018 } | 1020 } |
| 1019 | 1021 |
| 1020 @end | 1022 @end |
| OLD | NEW |