| 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/cocoa/about_window_controller.h" | 5 #import "chrome/browser/cocoa/about_window_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // instead of launching a new update check. recentShownInstallFailedStatus is | 122 // instead of launching a new update check. recentShownInstallFailedStatus is |
| 123 // maintained by -updateStatus:. | 123 // maintained by -updateStatus:. |
| 124 static BOOL recentShownUserActionFailedStatus = NO; | 124 static BOOL recentShownUserActionFailedStatus = NO; |
| 125 | 125 |
| 126 - (void)awakeFromNib { | 126 - (void)awakeFromNib { |
| 127 NSBundle* bundle = mac_util::MainAppBundle(); | 127 NSBundle* bundle = mac_util::MainAppBundle(); |
| 128 NSString* chromeVersion = | 128 NSString* chromeVersion = |
| 129 [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; | 129 [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; |
| 130 | 130 |
| 131 NSString* versionModifier = @""; | 131 NSString* versionModifier = @""; |
| 132 NSString* svnRevision = @""; |
| 132 string16 modifier = platform_util::GetVersionStringModifier(); | 133 string16 modifier = platform_util::GetVersionStringModifier(); |
| 133 if (modifier.length()) | 134 if (modifier.length()) |
| 134 versionModifier = [NSString stringWithFormat:@" %@", | 135 versionModifier = [NSString stringWithFormat:@" %@", |
| 135 base::SysUTF16ToNSString(modifier)]; | 136 base::SysUTF16ToNSString(modifier)]; |
| 136 | 137 |
| 138 #if !defined(GOOGLE_CHROME_BUILD) |
| 139 svnRevision = [NSString stringWithFormat:@" (%@)", |
| 140 [bundle objectForInfoDictionaryKey:@"SVNRevision"]]; |
| 141 #endif |
| 137 // The format string is not localized, but this is how the displayed version | 142 // The format string is not localized, but this is how the displayed version |
| 138 // is built on Windows too. | 143 // is built on Windows too. |
| 139 NSString* svnRevision = [bundle objectForInfoDictionaryKey:@"SVNRevision"]; | |
| 140 NSString* version = | 144 NSString* version = |
| 141 [NSString stringWithFormat:@"%@ (%@)%@", | 145 [NSString stringWithFormat:@"%@%@%@", |
| 142 chromeVersion, svnRevision, versionModifier]; | 146 chromeVersion, svnRevision, versionModifier]; |
| 143 | 147 |
| 144 [version_ setStringValue:version]; | 148 [version_ setStringValue:version]; |
| 145 | 149 |
| 146 // Put the two images into the UI. | 150 // Put the two images into the UI. |
| 147 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 151 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 148 NSImage* backgroundImage = rb.GetNSImageNamed(IDR_ABOUT_BACKGROUND_COLOR); | 152 NSImage* backgroundImage = rb.GetNSImageNamed(IDR_ABOUT_BACKGROUND_COLOR); |
| 149 DCHECK(backgroundImage); | 153 DCHECK(backgroundImage); |
| 150 [backgroundView_ setTileImage:backgroundImage]; | 154 [backgroundView_ setTileImage:backgroundImage]; |
| 151 NSImage* logoImage = rb.GetNSImageNamed(IDR_ABOUT_BACKGROUND); | 155 NSImage* logoImage = rb.GetNSImageNamed(IDR_ABOUT_BACKGROUND); |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 NSRange string_range = NSMakeRange(0, [legal_block length]); | 783 NSRange string_range = NSMakeRange(0, [legal_block length]); |
| 780 [legal_block addAttribute:NSFontAttributeName | 784 [legal_block addAttribute:NSFontAttributeName |
| 781 value:[NSFont labelFontOfSize:11] | 785 value:[NSFont labelFontOfSize:11] |
| 782 range:string_range]; | 786 range:string_range]; |
| 783 | 787 |
| 784 [legal_block endEditing]; | 788 [legal_block endEditing]; |
| 785 return legal_block; | 789 return legal_block; |
| 786 } | 790 } |
| 787 | 791 |
| 788 @end // @implementation AboutWindowController | 792 @end // @implementation AboutWindowController |
| OLD | NEW |