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

Side by Side Diff: chrome/common/l10n_util.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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 | « chrome/common/ipc_tests.cc ('k') | chrome/common/logging_chrome_uitest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/common/l10n_util.h" 9 #include "chrome/common/l10n_util.h"
10 10
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 // Represents the locale-specific text direction. 255 // Represents the locale-specific text direction.
256 static TextDirection g_text_direction = UNKNOWN_DIRECTION; 256 static TextDirection g_text_direction = UNKNOWN_DIRECTION;
257 257
258 std::wstring GetApplicationLocale(const std::wstring& pref_locale) { 258 std::wstring GetApplicationLocale(const std::wstring& pref_locale) {
259 std::wstring locale_path; 259 std::wstring locale_path;
260 PathService::Get(chrome::DIR_LOCALES, &locale_path); 260 PathService::Get(chrome::DIR_LOCALES, &locale_path);
261 std::wstring resolved_locale; 261 std::wstring resolved_locale;
262 262
263 // First, check to see if there's a --lang flag. 263 // First, check to see if there's a --lang flag.
264 CommandLine parsed_command_line; 264 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
265 const std::wstring& lang_arg = 265 const std::wstring& lang_arg =
266 parsed_command_line.GetSwitchValue(switches::kLang); 266 parsed_command_line.GetSwitchValue(switches::kLang);
267 if (!lang_arg.empty()) { 267 if (!lang_arg.empty()) {
268 if (CheckAndResolveLocale(lang_arg, locale_path, &resolved_locale)) 268 if (CheckAndResolveLocale(lang_arg, locale_path, &resolved_locale))
269 return resolved_locale; 269 return resolved_locale;
270 } 270 }
271 271
272 // Second, try user prefs. 272 // Second, try user prefs.
273 if (!pref_locale.empty()) { 273 if (!pref_locale.empty()) {
274 if (CheckAndResolveLocale(pref_locale, locale_path, &resolved_locale)) 274 if (CheckAndResolveLocale(pref_locale, locale_path, &resolved_locale))
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 } 674 }
675 675
676 void BiDiLineIterator::GetLogicalRun(int start, 676 void BiDiLineIterator::GetLogicalRun(int start,
677 int* end, 677 int* end,
678 UBiDiLevel* level) { 678 UBiDiLevel* level) {
679 DCHECK(bidi_ != NULL); 679 DCHECK(bidi_ != NULL);
680 ubidi_getLogicalRun(bidi_, start, end, level); 680 ubidi_getLogicalRun(bidi_, start, end, level);
681 } 681 }
682 682
683 } 683 }
OLDNEW
« no previous file with comments | « chrome/common/ipc_tests.cc ('k') | chrome/common/logging_chrome_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698