Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: ui/base/l10n/l10n_util_mac.mm

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/l10n/l10n_util.cc ('k') | ui/base/l10n/l10n_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
11 #include "ui/base/l10n/l10n_util.h" 11 #include "ui/base/l10n/l10n_util.h"
12 #include "ui/base/l10n/l10n_util_mac.h" 12 #include "ui/base/l10n/l10n_util_mac.h"
13 13
14 namespace { 14 namespace {
15 15
16 base::LazyInstance<std::string> g_overridden_locale = LAZY_INSTANCE_INITIALIZER; 16 base::LazyInstance<std::string>::DestructorAtExit g_overridden_locale =
17 LAZY_INSTANCE_INITIALIZER;
17 18
18 } // namespace 19 } // namespace
19 20
20 namespace l10n_util { 21 namespace l10n_util {
21 22
22 const std::string& GetLocaleOverride() { 23 const std::string& GetLocaleOverride() {
23 return g_overridden_locale.Get(); 24 return g_overridden_locale.Get();
24 } 25 }
25 26
26 void OverrideLocaleWithCocoaLocale() { 27 void OverrideLocaleWithCocoaLocale() {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return FixUpWindowsStyleLabel(l10n_util::GetStringFUTF16(message_id, 158 return FixUpWindowsStyleLabel(l10n_util::GetStringFUTF16(message_id,
158 a, b, c, d)); 159 a, b, c, d));
159 } 160 }
160 161
161 NSString* GetPluralNSStringF(int message_id, int number) { 162 NSString* GetPluralNSStringF(int message_id, int number) {
162 return base::SysUTF16ToNSString(l10n_util::GetPluralStringFUTF16(message_id, 163 return base::SysUTF16ToNSString(l10n_util::GetPluralStringFUTF16(message_id,
163 number)); 164 number));
164 } 165 }
165 166
166 } // namespace l10n_util 167 } // namespace l10n_util
OLDNEW
« no previous file with comments | « ui/base/l10n/l10n_util.cc ('k') | ui/base/l10n/l10n_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698