| 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.h" | 7 #include "app/l10n_util.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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 // window controller. | 621 // window controller. |
| 622 - (void)aboutWindowClosed:(NSNotification*)notify { | 622 - (void)aboutWindowClosed:(NSNotification*)notify { |
| 623 [[NSNotificationCenter defaultCenter] | 623 [[NSNotificationCenter defaultCenter] |
| 624 removeObserver:self | 624 removeObserver:self |
| 625 name:kUserClosedAboutNotification | 625 name:kUserClosedAboutNotification |
| 626 object:aboutController_.get()]; | 626 object:aboutController_.get()]; |
| 627 aboutController_.reset(NULL); | 627 aboutController_.reset(NULL); |
| 628 } | 628 } |
| 629 | 629 |
| 630 - (IBAction)orderFrontStandardAboutPanel:(id)sender { | 630 - (IBAction)orderFrontStandardAboutPanel:(id)sender { |
| 631 #if !defined(GOOGLE_CHROME_BUILD) | |
| 632 // If not branded behave like a generic Cocoa app. | |
| 633 [NSApp orderFrontStandardAboutPanel:sender]; | |
| 634 #else | |
| 635 // Otherwise bring up our special dialog (e.g. with an auto-update button). | 631 // Otherwise bring up our special dialog (e.g. with an auto-update button). |
| 636 if (!aboutController_) { | 632 if (!aboutController_) { |
| 637 aboutController_.reset([[AboutWindowController alloc] | 633 aboutController_.reset([[AboutWindowController alloc] |
| 638 initWithWindowNibName:@"About"]); | 634 initWithWindowNibName:@"About"]); |
| 639 if (!aboutController_) { | 635 if (!aboutController_) { |
| 640 // If we get here something is wacky. I managed to do it when | 636 // If we get here something is wacky. I managed to do it when |
| 641 // testing by explicitly forcing an auto-update to an older | 637 // testing by explicitly forcing an auto-update to an older |
| 642 // version then trying to open the about box again (missing | 638 // version then trying to open the about box again (missing |
| 643 // nib). This shouldn't be possible in general but let's try | 639 // nib). This shouldn't be possible in general but let's try |
| 644 // hard to not do nothing. | 640 // hard to not do nothing. |
| 645 [NSApp orderFrontStandardAboutPanel:sender]; | 641 [NSApp orderFrontStandardAboutPanel:sender]; |
| 646 return; | 642 return; |
| 647 } | 643 } |
| 648 // Watch for a notification of when it goes away so that we can destroy | 644 // Watch for a notification of when it goes away so that we can destroy |
| 649 // the controller. | 645 // the controller. |
| 650 [[NSNotificationCenter defaultCenter] | 646 [[NSNotificationCenter defaultCenter] |
| 651 addObserver:self | 647 addObserver:self |
| 652 selector:@selector(aboutWindowClosed:) | 648 selector:@selector(aboutWindowClosed:) |
| 653 name:kUserClosedAboutNotification | 649 name:kUserClosedAboutNotification |
| 654 object:aboutController_.get()]; | 650 object:aboutController_.get()]; |
| 655 } | 651 } |
| 656 if (![[aboutController_ window] isVisible]) | 652 if (![[aboutController_ window] isVisible]) |
| 657 [[aboutController_ window] center]; | 653 [[aboutController_ window] center]; |
| 658 [aboutController_ showWindow:self]; | 654 [aboutController_ showWindow:self]; |
| 659 #endif | |
| 660 } | 655 } |
| 661 | 656 |
| 662 @end | 657 @end |
| OLD | NEW |