| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines utility functions for fetching localized resources. | 5 // This file defines utility functions for fetching localized resources. |
| 6 | 6 |
| 7 #include "chrome/installer/util/l10n_string_util.h" | 7 #include "chrome/installer/util/l10n_string_util.h" |
| 8 | 8 |
| 9 #include <atlbase.h> | 9 #include <atlbase.h> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 localized_string = std::wstring(image->achString, image->nLength); | 50 localized_string = std::wstring(image->achString, image->nLength); |
| 51 } else { | 51 } else { |
| 52 NOTREACHED() << "Unable to find resource id " << message_id; | 52 NOTREACHED() << "Unable to find resource id " << message_id; |
| 53 } | 53 } |
| 54 | 54 |
| 55 return localized_string; | 55 return localized_string; |
| 56 } | 56 } |
| 57 | 57 |
| 58 base::string16 GetLocalizedStringF(int base_message_id, | 58 base::string16 GetLocalizedStringF(int base_message_id, |
| 59 const base::string16& a) { | 59 const base::string16& a) { |
| 60 return ReplaceStringPlaceholders(GetLocalizedString(base_message_id), | 60 return base::ReplaceStringPlaceholders( |
| 61 std::vector<base::string16>(1, a), | 61 GetLocalizedString(base_message_id), |
| 62 NULL); | 62 std::vector<base::string16>(1, a), |
| 63 NULL); |
| 63 } | 64 } |
| 64 | 65 |
| 65 // Here we generate the url spec with the Microsoft res:// scheme which is | 66 // Here we generate the url spec with the Microsoft res:// scheme which is |
| 66 // explained here : http://support.microsoft.com/kb/220830 | 67 // explained here : http://support.microsoft.com/kb/220830 |
| 67 std::wstring GetLocalizedEulaResource() { | 68 std::wstring GetLocalizedEulaResource() { |
| 68 wchar_t full_exe_path[MAX_PATH]; | 69 wchar_t full_exe_path[MAX_PATH]; |
| 69 int len = ::GetModuleFileName(NULL, full_exe_path, MAX_PATH); | 70 int len = ::GetModuleFileName(NULL, full_exe_path, MAX_PATH); |
| 70 if (len == 0 || len == MAX_PATH) | 71 if (len == 0 || len == MAX_PATH) |
| 71 return L""; | 72 return L""; |
| 72 | 73 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 96 if (SUCCEEDED(hr)) | 97 if (SUCCEEDED(hr)) |
| 97 return std::wstring(url_canon.get()); | 98 return std::wstring(url_canon.get()); |
| 98 return url_path; | 99 return url_path; |
| 99 } | 100 } |
| 100 | 101 |
| 101 std::wstring GetCurrentTranslation() { | 102 std::wstring GetCurrentTranslation() { |
| 102 return GetLanguageSelector().selected_translation(); | 103 return GetLanguageSelector().selected_translation(); |
| 103 } | 104 } |
| 104 | 105 |
| 105 } // namespace installer | 106 } // namespace installer |
| OLD | NEW |