| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/extensions/extension_l10n_util.h" | 5 #include "chrome/common/extensions/extension_l10n_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 DictionaryValue* handler = NULL; | 119 DictionaryValue* handler = NULL; |
| 120 if (!file_handlers->GetDictionary(i, &handler)) { | 120 if (!file_handlers->GetDictionary(i, &handler)) { |
| 121 *error = errors::kInvalidFileBrowserHandler; | 121 *error = errors::kInvalidFileBrowserHandler; |
| 122 return false; | 122 return false; |
| 123 } | 123 } |
| 124 if (!LocalizeManifestValue(keys::kPageActionDefaultTitle, messages, | 124 if (!LocalizeManifestValue(keys::kPageActionDefaultTitle, messages, |
| 125 handler, error)) | 125 handler, error)) |
| 126 return false; | 126 return false; |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 |
| 130 // Initialize app.launch.local_path. |
| 131 if (!LocalizeManifestValue(keys::kLaunchLocalPath, messages, manifest, error)) |
| 132 return false; |
| 133 |
| 134 // Initialize app.launch.web_url. |
| 135 if (!LocalizeManifestValue(keys::kLaunchWebURL, messages, manifest, error)) |
| 136 return false; |
| 137 |
| 129 // Add current locale key to the manifest, so we can overwrite prefs | 138 // Add current locale key to the manifest, so we can overwrite prefs |
| 130 // with new manifest when chrome locale changes. | 139 // with new manifest when chrome locale changes. |
| 131 manifest->SetString(keys::kCurrentLocale, CurrentLocaleOrDefault()); | 140 manifest->SetString(keys::kCurrentLocale, CurrentLocaleOrDefault()); |
| 132 return true; | 141 return true; |
| 133 } | 142 } |
| 134 | 143 |
| 135 bool LocalizeExtension(const FilePath& extension_path, | 144 bool LocalizeExtension(const FilePath& extension_path, |
| 136 DictionaryValue* manifest, | 145 DictionaryValue* manifest, |
| 137 std::string* error) { | 146 std::string* error) { |
| 138 DCHECK(manifest); | 147 DCHECK(manifest); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 if (std::find(subdir.begin(), subdir.end(), '.') != subdir.end()) | 315 if (std::find(subdir.begin(), subdir.end(), '.') != subdir.end()) |
| 307 return true; | 316 return true; |
| 308 | 317 |
| 309 if (all_locales.find(subdir) == all_locales.end()) | 318 if (all_locales.find(subdir) == all_locales.end()) |
| 310 return true; | 319 return true; |
| 311 | 320 |
| 312 return false; | 321 return false; |
| 313 } | 322 } |
| 314 | 323 |
| 315 } // namespace extension_l10n_util | 324 } // namespace extension_l10n_util |
| OLD | NEW |