OLD | NEW |
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 Loading... |
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 |
OLD | NEW |