| 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 | 740 |
| 741 // Watch for a notification of when it goes away so that we can destroy | 741 // Watch for a notification of when it goes away so that we can destroy |
| 742 // the controller. | 742 // the controller. |
| 743 [[NSNotificationCenter defaultCenter] | 743 [[NSNotificationCenter defaultCenter] |
| 744 addObserver:self | 744 addObserver:self |
| 745 selector:@selector(aboutWindowClosed:) | 745 selector:@selector(aboutWindowClosed:) |
| 746 name:kUserClosedAboutNotification | 746 name:kUserClosedAboutNotification |
| 747 object:aboutController_.get()]; | 747 object:aboutController_.get()]; |
| 748 } | 748 } |
| 749 | 749 |
| 750 if (![[aboutController_ window] isVisible]) | |
| 751 [[aboutController_ window] center]; | |
| 752 | |
| 753 [aboutController_ showWindow:self]; | 750 [aboutController_ showWindow:self]; |
| 754 } | 751 } |
| 755 | 752 |
| 756 // Explicitly bring to the foreground when creating new windows from the dock. | 753 // Explicitly bring to the foreground when creating new windows from the dock. |
| 757 - (void)newWindowFromDock:(id)sender { | 754 - (void)newWindowFromDock:(id)sender { |
| 758 [NSApp activateIgnoringOtherApps:YES]; | 755 [NSApp activateIgnoringOtherApps:YES]; |
| 759 [self commandDispatch:sender]; | 756 [self commandDispatch:sender]; |
| 760 } | 757 } |
| 761 | 758 |
| 762 - (NSMenu*)applicationDockMenu:(id)sender { | 759 - (NSMenu*)applicationDockMenu:(id)sender { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 793 [appController showPreferencesWindow:nil page:page profile:profile]; | 790 [appController showPreferencesWindow:nil page:page profile:profile]; |
| 794 } | 791 } |
| 795 | 792 |
| 796 namespace app_controller_mac { | 793 namespace app_controller_mac { |
| 797 | 794 |
| 798 bool IsOpeningNewWindow() { | 795 bool IsOpeningNewWindow() { |
| 799 return g_is_opening_new_window; | 796 return g_is_opening_new_window; |
| 800 } | 797 } |
| 801 | 798 |
| 802 } // namespace app_controller_mac | 799 } // namespace app_controller_mac |
| OLD | NEW |