OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ui/base/l10n/l10n_util_win.h" | 5 #include "ui/base/l10n/l10n_util_win.h" |
6 | 6 |
7 #include <windowsx.h> | 7 #include <windowsx.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 OverrideLocaleHolder() {} | 69 OverrideLocaleHolder() {} |
70 const std::vector<std::string>& value() const { return value_; } | 70 const std::vector<std::string>& value() const { return value_; } |
71 void swap_value(std::vector<std::string>* override_value) { | 71 void swap_value(std::vector<std::string>* override_value) { |
72 value_.swap(*override_value); | 72 value_.swap(*override_value); |
73 } | 73 } |
74 private: | 74 private: |
75 std::vector<std::string> value_; | 75 std::vector<std::string> value_; |
76 DISALLOW_COPY_AND_ASSIGN(OverrideLocaleHolder); | 76 DISALLOW_COPY_AND_ASSIGN(OverrideLocaleHolder); |
77 }; | 77 }; |
78 | 78 |
79 base::LazyInstance<OverrideLocaleHolder> override_locale_holder = | 79 base::LazyInstance<OverrideLocaleHolder>::DestructorAtExit |
80 LAZY_INSTANCE_INITIALIZER; | 80 override_locale_holder = LAZY_INSTANCE_INITIALIZER; |
81 | 81 |
82 } // namespace | 82 } // namespace |
83 | 83 |
84 namespace l10n_util { | 84 namespace l10n_util { |
85 | 85 |
86 int GetExtendedStyles() { | 86 int GetExtendedStyles() { |
87 return !base::i18n::IsRTL() ? 0 : WS_EX_LAYOUTRTL | WS_EX_RTLREADING; | 87 return !base::i18n::IsRTL() ? 0 : WS_EX_LAYOUTRTL | WS_EX_RTLREADING; |
88 } | 88 } |
89 | 89 |
90 int GetExtendedTooltipStyles() { | 90 int GetExtendedTooltipStyles() { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } else { | 196 } else { |
197 NOTREACHED() << "Failed to determine the UI language for locale override."; | 197 NOTREACHED() << "Failed to determine the UI language for locale override."; |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 const std::vector<std::string>& GetLocaleOverrides() { | 201 const std::vector<std::string>& GetLocaleOverrides() { |
202 return override_locale_holder.Get().value(); | 202 return override_locale_holder.Get().value(); |
203 } | 203 } |
204 | 204 |
205 } // namespace l10n_util | 205 } // namespace l10n_util |
OLD | NEW |