| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/extension_l10n_util.h" | 5 #include "extensions/common/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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 if (!file_handlers->GetDictionary(i, &handler)) { | 177 if (!file_handlers->GetDictionary(i, &handler)) { |
| 178 *error = errors::kInvalidFileBrowserHandler; | 178 *error = errors::kInvalidFileBrowserHandler; |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 if (!LocalizeManifestValue( | 181 if (!LocalizeManifestValue( |
| 182 keys::kPageActionDefaultTitle, messages, handler, error)) | 182 keys::kPageActionDefaultTitle, messages, handler, error)) |
| 183 return false; | 183 return false; |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 base::ListValue* media_galleries_handlers = NULL; | |
| 188 if (manifest->GetList(keys::kMediaGalleriesHandlers, | |
| 189 &media_galleries_handlers)) { | |
| 190 key.assign(keys::kMediaGalleriesHandlers); | |
| 191 for (size_t i = 0; i < media_galleries_handlers->GetSize(); i++) { | |
| 192 base::DictionaryValue* handler = NULL; | |
| 193 if (!media_galleries_handlers->GetDictionary(i, &handler)) { | |
| 194 *error = errors::kInvalidMediaGalleriesHandler; | |
| 195 return false; | |
| 196 } | |
| 197 if (!LocalizeManifestValue( | |
| 198 keys::kPageActionDefaultTitle, messages, handler, error)) | |
| 199 return false; | |
| 200 } | |
| 201 } | |
| 202 | |
| 203 // Initialize all input_components | 187 // Initialize all input_components |
| 204 base::ListValue* input_components = NULL; | 188 base::ListValue* input_components = NULL; |
| 205 if (manifest->GetList(keys::kInputComponents, &input_components)) { | 189 if (manifest->GetList(keys::kInputComponents, &input_components)) { |
| 206 for (size_t i = 0; i < input_components->GetSize(); ++i) { | 190 for (size_t i = 0; i < input_components->GetSize(); ++i) { |
| 207 base::DictionaryValue* module = NULL; | 191 base::DictionaryValue* module = NULL; |
| 208 if (!input_components->GetDictionary(i, &module)) { | 192 if (!input_components->GetDictionary(i, &module)) { |
| 209 *error = errors::kInvalidInputComponents; | 193 *error = errors::kInvalidInputComponents; |
| 210 return false; | 194 return false; |
| 211 } | 195 } |
| 212 if (!LocalizeManifestValue(keys::kName, messages, module, error)) | 196 if (!LocalizeManifestValue(keys::kName, messages, module, error)) |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale) | 453 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale) |
| 470 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) { | 454 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) { |
| 471 extension_l10n_util::SetProcessLocale(locale); | 455 extension_l10n_util::SetProcessLocale(locale); |
| 472 } | 456 } |
| 473 | 457 |
| 474 ScopedLocaleForTest::~ScopedLocaleForTest() { | 458 ScopedLocaleForTest::~ScopedLocaleForTest() { |
| 475 extension_l10n_util::SetProcessLocale(locale_); | 459 extension_l10n_util::SetProcessLocale(locale_); |
| 476 } | 460 } |
| 477 | 461 |
| 478 } // namespace extension_l10n_util | 462 } // namespace extension_l10n_util |
| OLD | NEW |