| 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 "app/app_switches.h" | 5 #include "app/app_switches.h" |
| 6 #include "app/l10n_util.h" | 6 #include "app/l10n_util.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 bool GetApplicationDirectory(FilePath* path) { | 24 bool GetApplicationDirectory(FilePath* path) { |
| 25 return PathService::Get(chrome::DIR_APP, path); | 25 return PathService::Get(chrome::DIR_APP, path); |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool IsPluginRunningInRendererProcess() { | 28 bool IsPluginRunningInRendererProcess() { |
| 29 return !IsPluginProcess(); | 29 return !IsPluginProcess(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 std::wstring GetWebKitLocale() { | 32 std::string GetWebKitLocale() { |
| 33 // The browser process should have passed the locale to the renderer via the | 33 // The browser process should have passed the locale to the renderer via the |
| 34 // --lang command line flag. In single process mode, this will return the | 34 // --lang command line flag. In single process mode, this will return the |
| 35 // wrong value. TODO(tc): Fix this for single process mode. | 35 // wrong value. TODO(tc): Fix this for single process mode. |
| 36 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 36 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 37 const std::wstring& lang = | 37 const std::string& lang = |
| 38 parsed_command_line.GetSwitchValue(switches::kLang); | 38 parsed_command_line.GetSwitchValueASCII(switches::kLang); |
| 39 DCHECK(!lang.empty() || | 39 DCHECK(!lang.empty() || |
| 40 (!parsed_command_line.HasSwitch(switches::kRendererProcess) && | 40 (!parsed_command_line.HasSwitch(switches::kRendererProcess) && |
| 41 !parsed_command_line.HasSwitch(switches::kPluginProcess))); | 41 !parsed_command_line.HasSwitch(switches::kPluginProcess))); |
| 42 return lang; | 42 return lang; |
| 43 } | 43 } |
| 44 | 44 |
| 45 string16 GetLocalizedString(int message_id) { | 45 string16 GetLocalizedString(int message_id) { |
| 46 return WideToUTF16(l10n_util::GetString(message_id)); | 46 return WideToUTF16(l10n_util::GetString(message_id)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace webkit_glue | 49 } // namespace webkit_glue |
| OLD | NEW |