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 #include "chrome/browser/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 void ComponentLoader::AddBookmarksExtensions() { | 304 void ComponentLoader::AddBookmarksExtensions() { |
305 Add(IDR_BOOKMARKS_MANIFEST, | 305 Add(IDR_BOOKMARKS_MANIFEST, |
306 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 306 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
307 #if defined(ENABLE_ENHANCED_BOOKMARKS) | 307 #if defined(ENABLE_ENHANCED_BOOKMARKS) |
308 Add(IDR_ENHANCED_BOOKMARKS_MANIFEST, | 308 Add(IDR_ENHANCED_BOOKMARKS_MANIFEST, |
309 base::FilePath(FILE_PATH_LITERAL("enhanced_bookmark_manager"))); | 309 base::FilePath(FILE_PATH_LITERAL("enhanced_bookmark_manager"))); |
310 #endif | 310 #endif |
311 } | 311 } |
312 | 312 |
| 313 void ComponentLoader::AddNetworkSpeechSynthesisExtension() { |
| 314 #if defined(GOOGLE_CHROME_BUILD) |
| 315 std::string network_speech_synthesis_id = Add( |
| 316 IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST, |
| 317 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis"))); |
| 318 #endif // defined(GOOGLE_CHROME_BUILD) |
| 319 } |
| 320 |
313 void ComponentLoader::AddWithName(int manifest_resource_id, | 321 void ComponentLoader::AddWithName(int manifest_resource_id, |
314 const base::FilePath& root_directory, | 322 const base::FilePath& root_directory, |
315 const std::string& name) { | 323 const std::string& name) { |
316 std::string manifest_contents = | 324 std::string manifest_contents = |
317 ResourceBundle::GetSharedInstance().GetRawDataResource( | 325 ResourceBundle::GetSharedInstance().GetRawDataResource( |
318 manifest_resource_id).as_string(); | 326 manifest_resource_id).as_string(); |
319 | 327 |
320 // The Value is kept for the lifetime of the ComponentLoader. This is | 328 // The Value is kept for the lifetime of the ComponentLoader. This is |
321 // required in case LoadAll() is called again. | 329 // required in case LoadAll() is called again. |
322 base::DictionaryValue* manifest = ParseManifest(manifest_contents); | 330 base::DictionaryValue* manifest = ParseManifest(manifest_contents); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 if ((field_trial_result.compare( | 511 if ((field_trial_result.compare( |
504 0, | 512 0, |
505 enable_prefix.length(), | 513 enable_prefix.length(), |
506 enable_prefix) == 0) || | 514 enable_prefix) == 0) || |
507 CommandLine::ForCurrentProcess()->HasSwitch( | 515 CommandLine::ForCurrentProcess()->HasSwitch( |
508 switches::kEnableGoogleNowIntegration)) { | 516 switches::kEnableGoogleNowIntegration)) { |
509 Add(IDR_GOOGLE_NOW_MANIFEST, | 517 Add(IDR_GOOGLE_NOW_MANIFEST, |
510 base::FilePath(FILE_PATH_LITERAL("google_now"))); | 518 base::FilePath(FILE_PATH_LITERAL("google_now"))); |
511 } | 519 } |
512 #endif | 520 #endif |
| 521 |
| 522 AddNetworkSpeechSynthesisExtension(); |
513 } | 523 } |
514 | 524 |
515 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 525 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
516 delete component->manifest; | 526 delete component->manifest; |
517 if (extension_service_->is_ready()) { | 527 if (extension_service_->is_ready()) { |
518 extension_service_-> | 528 extension_service_-> |
519 RemoveComponentExtension(component->extension_id); | 529 RemoveComponentExtension(component->extension_id); |
520 } | 530 } |
521 } | 531 } |
522 | 532 |
523 } // namespace extensions | 533 } // namespace extensions |
OLD | NEW |