| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 base::FilePath(FILE_PATH_LITERAL("audio_player"))); | 310 base::FilePath(FILE_PATH_LITERAL("audio_player"))); |
| 311 #endif // defined(OS_CHROMEOS) | 311 #endif // defined(OS_CHROMEOS) |
| 312 } | 312 } |
| 313 | 313 |
| 314 void ComponentLoader::AddGalleryExtension() { | 314 void ComponentLoader::AddGalleryExtension() { |
| 315 #if defined(OS_CHROMEOS) | 315 #if defined(OS_CHROMEOS) |
| 316 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery"))); | 316 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery"))); |
| 317 #endif | 317 #endif |
| 318 } | 318 } |
| 319 | 319 |
| 320 void ComponentLoader::AddZipArchiverExtension() { |
| 321 #if defined(OS_CHROMEOS) |
| 322 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 323 chromeos::switches::kEnableZipArchiverOnFileManager)) { |
| 324 Add(IDR_ZIP_ARCHIVER_MANIFEST, |
| 325 base::FilePath(FILE_PATH_LITERAL("zip_archiver"))); |
| 326 } |
| 327 #endif // defined(OS_CHROMEOS) |
| 328 } |
| 329 |
| 320 void ComponentLoader::AddWebstoreWidgetExtension() { | 330 void ComponentLoader::AddWebstoreWidgetExtension() { |
| 321 #if defined(OS_CHROMEOS) | 331 #if defined(OS_CHROMEOS) |
| 322 AddWithNameAndDescription( | 332 AddWithNameAndDescription( |
| 323 IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST, | 333 IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST, |
| 324 base::FilePath(FILE_PATH_LITERAL("webstore_widget")), | 334 base::FilePath(FILE_PATH_LITERAL("webstore_widget")), |
| 325 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_NAME), | 335 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_NAME), |
| 326 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_DESC)); | 336 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_DESC)); |
| 327 #endif | 337 #endif |
| 328 } | 338 } |
| 329 | 339 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME), | 556 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME), |
| 547 l10n_util::GetStringFUTF8(IDS_GENIUS_APP_DESCRIPTION, | 557 l10n_util::GetStringFUTF8(IDS_GENIUS_APP_DESCRIPTION, |
| 548 ash::GetChromeOSDeviceName())); | 558 ash::GetChromeOSDeviceName())); |
| 549 #endif | 559 #endif |
| 550 | 560 |
| 551 if (!skip_session_components) { | 561 if (!skip_session_components) { |
| 552 AddVideoPlayerExtension(); | 562 AddVideoPlayerExtension(); |
| 553 AddAudioPlayerExtension(); | 563 AddAudioPlayerExtension(); |
| 554 AddFileManagerExtension(); | 564 AddFileManagerExtension(); |
| 555 AddGalleryExtension(); | 565 AddGalleryExtension(); |
| 566 AddZipArchiverExtension(); |
| 556 AddWebstoreWidgetExtension(); | 567 AddWebstoreWidgetExtension(); |
| 557 | 568 |
| 558 AddHangoutServicesExtension(); | 569 AddHangoutServicesExtension(); |
| 559 AddHotwordAudioVerificationApp(); | 570 AddHotwordAudioVerificationApp(); |
| 560 AddHotwordHelperExtension(); | 571 AddHotwordHelperExtension(); |
| 561 AddImageLoaderExtension(); | 572 AddImageLoaderExtension(); |
| 562 | 573 |
| 563 bool install_feedback = enable_background_extensions_during_testing; | 574 bool install_feedback = enable_background_extensions_during_testing; |
| 564 #if defined(GOOGLE_CHROME_BUILD) | 575 #if defined(GOOGLE_CHROME_BUILD) |
| 565 install_feedback = true; | 576 install_feedback = true; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 return; // Error already logged. | 695 return; // Error already logged. |
| 685 std::string actual_extension_id = | 696 std::string actual_extension_id = |
| 686 Add(std::move(manifest), root_directory, false); | 697 Add(std::move(manifest), root_directory, false); |
| 687 CHECK_EQ(extension_id, actual_extension_id); | 698 CHECK_EQ(extension_id, actual_extension_id); |
| 688 if (!done_cb.is_null()) | 699 if (!done_cb.is_null()) |
| 689 done_cb.Run(); | 700 done_cb.Run(); |
| 690 } | 701 } |
| 691 #endif | 702 #endif |
| 692 | 703 |
| 693 } // namespace extensions | 704 } // namespace extensions |
| OLD | NEW |