| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 773 |
| 774 // Watch for a notification of when it goes away so that we can destroy | 774 // Watch for a notification of when it goes away so that we can destroy |
| 775 // the controller. | 775 // the controller. |
| 776 [[NSNotificationCenter defaultCenter] | 776 [[NSNotificationCenter defaultCenter] |
| 777 addObserver:self | 777 addObserver:self |
| 778 selector:@selector(aboutWindowClosed:) | 778 selector:@selector(aboutWindowClosed:) |
| 779 name:NSWindowWillCloseNotification | 779 name:NSWindowWillCloseNotification |
| 780 object:[aboutController_ window]]; | 780 object:[aboutController_ window]]; |
| 781 } | 781 } |
| 782 | 782 |
| 783 if (![[aboutController_ window] isVisible]) | |
| 784 [[aboutController_ window] center]; | |
| 785 | |
| 786 [aboutController_ showWindow:self]; | 783 [aboutController_ showWindow:self]; |
| 787 } | 784 } |
| 788 | 785 |
| 789 // Explicitly bring to the foreground when creating new windows from the dock. | 786 // Explicitly bring to the foreground when creating new windows from the dock. |
| 790 - (void)newWindowFromDock:(id)sender { | 787 - (void)newWindowFromDock:(id)sender { |
| 791 [NSApp activateIgnoringOtherApps:YES]; | 788 [NSApp activateIgnoringOtherApps:YES]; |
| 792 [self commandDispatch:sender]; | 789 [self commandDispatch:sender]; |
| 793 } | 790 } |
| 794 | 791 |
| 795 - (NSMenu*)applicationDockMenu:(id)sender { | 792 - (NSMenu*)applicationDockMenu:(id)sender { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 826 [appController showPreferencesWindow:nil page:page profile:profile]; | 823 [appController showPreferencesWindow:nil page:page profile:profile]; |
| 827 } | 824 } |
| 828 | 825 |
| 829 namespace app_controller_mac { | 826 namespace app_controller_mac { |
| 830 | 827 |
| 831 bool IsOpeningNewWindow() { | 828 bool IsOpeningNewWindow() { |
| 832 return g_is_opening_new_window; | 829 return g_is_opening_new_window; |
| 833 } | 830 } |
| 834 | 831 |
| 835 } // namespace app_controller_mac | 832 } // namespace app_controller_mac |
| OLD | NEW |