diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-27 16:42:22 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-27 16:42:22 +0000 |
commit | 207dace0b40c1b970be61a65fd0040beb06df7b2 (patch) | |
tree | 9ed2a40b2400a246952e381f55b66fea5ba34c58 /chrome/browser/cocoa | |
parent | 6fe4e841191055b69f5df33002e78d75bfdcf725 (diff) | |
download | chromium_src-207dace0b40c1b970be61a65fd0040beb06df7b2.zip chromium_src-207dace0b40c1b970be61a65fd0040beb06df7b2.tar.gz chromium_src-207dace0b40c1b970be61a65fd0040beb06df7b2.tar.bz2 |
Use correct branding on the "make default browser" button. Create a new localizer subclass for the prefs window.
BUG=12534
TEST=make sure branding is correct on default browser button.
Review URL: http://codereview.chromium.org/115817
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/preferences_localizer.h | 18 | ||||
-rw-r--r-- | chrome/browser/cocoa/preferences_localizer.mm | 28 |
2 files changed, 46 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/preferences_localizer.h b/chrome/browser/cocoa/preferences_localizer.h new file mode 100644 index 0000000..8f25ae6 --- /dev/null +++ b/chrome/browser/cocoa/preferences_localizer.h @@ -0,0 +1,18 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_COCOA_PREFERENCES_LOCALIZER_H_ +#define CHROME_BROWSER_COCOA_PREFERENCES_LOCALIZER_H_ + +#import <Cocoa/Cocoa.h> + +#import "third_party/GTM/AppKit/GTMUILocalizer.h" + +// A subclass of GTMUILocalizer that handles localizing our prefs window. +// It maps from the ^-prefixed strings in the nib into the strings bundles. + +@interface PreferencesLocalizer : GTMUILocalizer +@end + +#endif // CHROME_BROWSER_COCOA_PREFERENCES_LOCALIZER_H_ diff --git a/chrome/browser/cocoa/preferences_localizer.mm b/chrome/browser/cocoa/preferences_localizer.mm new file mode 100644 index 0000000..0e0ec9d --- /dev/null +++ b/chrome/browser/cocoa/preferences_localizer.mm @@ -0,0 +1,28 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "chrome/browser/cocoa/preferences_localizer.h" + +#include "app/l10n_util.h" +#include "base/sys_string_conversions.h" +#include "grit/chromium_strings.h" +#include "grit/generated_resources.h" + +@implementation PreferencesLocalizer + +// Override to map into our string bundles instead of strings plists. +// TODO(pinkerton): This should use a string lookup table to map the string to +// a constant. +- (NSString *)localizedStringForString:(NSString *)string { + if ([string isEqualToString: + @"^Make Chromium My Default Browser"]) { + std::wstring tempString = + l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_USEASDEFAULT, + l10n_util::GetString(IDS_PRODUCT_NAME)); + return base::SysWideToNSString(tempString); + } + return [super localizedStringForString:string]; +} + +@end |