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

Side by Side Diff: chrome/common/common_glue.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/chrome_plugin_util.cc ('k') | chrome/common/debug_flags.h » ('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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "chrome/common/chrome_paths.h" 7 #include "chrome/common/chrome_paths.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/l10n_util.h" 9 #include "chrome/common/l10n_util.h"
10 #include "chrome/plugin/npobject_util.h" 10 #include "chrome/plugin/npobject_util.h"
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 bool IsPluginRunningInRendererProcess() { 24 bool IsPluginRunningInRendererProcess() {
25 return !IsPluginProcess(); 25 return !IsPluginProcess();
26 } 26 }
27 27
28 std::wstring GetWebKitLocale() { 28 std::wstring GetWebKitLocale() {
29 // The browser process should have passed the locale to the renderer via the 29 // The browser process should have passed the locale to the renderer via the
30 // --lang command line flag. In single process mode, this will return the 30 // --lang command line flag. In single process mode, this will return the
31 // wrong value. TODO(tc): Fix this for single process mode. 31 // wrong value. TODO(tc): Fix this for single process mode.
32 CommandLine parsed_command_line; 32 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
33 const std::wstring& lang = 33 const std::wstring& lang =
34 parsed_command_line.GetSwitchValue(switches::kLang); 34 parsed_command_line.GetSwitchValue(switches::kLang);
35 DCHECK(!lang.empty() || 35 DCHECK(!lang.empty() ||
36 (!parsed_command_line.HasSwitch(switches::kRendererProcess) && 36 (!parsed_command_line.HasSwitch(switches::kRendererProcess) &&
37 !parsed_command_line.HasSwitch(switches::kPluginProcess))); 37 !parsed_command_line.HasSwitch(switches::kPluginProcess)));
38 return lang; 38 return lang;
39 } 39 }
40 40
41 std::wstring GetLocalizedString(int message_id) { 41 std::wstring GetLocalizedString(int message_id) {
42 return l10n_util::GetString(message_id); 42 return l10n_util::GetString(message_id);
43 } 43 }
44 44
45 } // namespace webkit_glue 45 } // namespace webkit_glue
46 46
OLDNEW
« no previous file with comments | « chrome/common/chrome_plugin_util.cc ('k') | chrome/common/debug_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698