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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 #endif // defined(OS_CHROMEOS) | 281 #endif // defined(OS_CHROMEOS) |
282 } | 282 } |
283 | 283 |
284 void ComponentLoader::AddVideoPlayerExtension() { | 284 void ComponentLoader::AddVideoPlayerExtension() { |
285 #if defined(OS_CHROMEOS) | 285 #if defined(OS_CHROMEOS) |
286 Add(IDR_VIDEO_PLAYER_MANIFEST, | 286 Add(IDR_VIDEO_PLAYER_MANIFEST, |
287 base::FilePath(FILE_PATH_LITERAL("video_player"))); | 287 base::FilePath(FILE_PATH_LITERAL("video_player"))); |
288 #endif // defined(OS_CHROMEOS) | 288 #endif // defined(OS_CHROMEOS) |
289 } | 289 } |
290 | 290 |
| 291 void ComponentLoader::AddAudioPlayerExtension() { |
| 292 #if defined(OS_CHROMEOS) |
| 293 Add(IDR_AUDIO_PLAYER_MANIFEST, |
| 294 base::FilePath(FILE_PATH_LITERAL("audio_player"))); |
| 295 #endif // defined(OS_CHROMEOS) |
| 296 } |
| 297 |
291 void ComponentLoader::AddGalleryExtension() { | 298 void ComponentLoader::AddGalleryExtension() { |
292 #if defined(OS_CHROMEOS) | 299 #if defined(OS_CHROMEOS) |
293 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery"))); | 300 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery"))); |
294 #endif | 301 #endif |
295 } | 302 } |
296 | 303 |
297 void ComponentLoader::AddHangoutServicesExtension() { | 304 void ComponentLoader::AddHangoutServicesExtension() { |
298 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) | 305 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) |
299 Add(IDR_HANGOUT_SERVICES_MANIFEST, | 306 Add(IDR_HANGOUT_SERVICES_MANIFEST, |
300 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); | 307 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 491 } |
485 | 492 |
486 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( | 493 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( |
487 bool skip_session_components) { | 494 bool skip_session_components) { |
488 // No component extension for kiosk app launch splash screen. | 495 // No component extension for kiosk app launch splash screen. |
489 if (skip_session_components) | 496 if (skip_session_components) |
490 return; | 497 return; |
491 | 498 |
492 // Component extensions needed for kiosk apps. | 499 // Component extensions needed for kiosk apps. |
493 AddVideoPlayerExtension(); | 500 AddVideoPlayerExtension(); |
| 501 AddAudioPlayerExtension(); |
494 AddFileManagerExtension(); | 502 AddFileManagerExtension(); |
495 AddGalleryExtension(); | 503 AddGalleryExtension(); |
496 | 504 |
497 // Add virtual keyboard. | 505 // Add virtual keyboard. |
498 AddKeyboardApp(); | 506 AddKeyboardApp(); |
499 } | 507 } |
500 | 508 |
501 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( | 509 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
502 bool skip_session_components) { | 510 bool skip_session_components) { |
503 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 511 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
(...skipping 11 matching lines...) Expand all Loading... |
515 // Since this is a v2 app it has a background page. | 523 // Since this is a v2 app it has a background page. |
516 AddWithNameAndDescription(IDR_GENIUS_APP_MANIFEST, | 524 AddWithNameAndDescription(IDR_GENIUS_APP_MANIFEST, |
517 base::FilePath(FILE_PATH_LITERAL( | 525 base::FilePath(FILE_PATH_LITERAL( |
518 "/usr/share/chromeos-assets/genius_app")), | 526 "/usr/share/chromeos-assets/genius_app")), |
519 IDS_GENIUS_APP_NAME, | 527 IDS_GENIUS_APP_NAME, |
520 IDS_GENIUS_APP_DESCRIPTION); | 528 IDS_GENIUS_APP_DESCRIPTION); |
521 #endif | 529 #endif |
522 | 530 |
523 if (!skip_session_components) { | 531 if (!skip_session_components) { |
524 AddVideoPlayerExtension(); | 532 AddVideoPlayerExtension(); |
| 533 AddAudioPlayerExtension(); |
525 AddFileManagerExtension(); | 534 AddFileManagerExtension(); |
526 AddGalleryExtension(); | 535 AddGalleryExtension(); |
527 | 536 |
528 AddHangoutServicesExtension(); | 537 AddHangoutServicesExtension(); |
529 AddHotwordAudioVerificationApp(); | 538 AddHotwordAudioVerificationApp(); |
530 AddHotwordHelperExtension(); | 539 AddHotwordHelperExtension(); |
531 AddImageLoaderExtension(); | 540 AddImageLoaderExtension(); |
532 | 541 |
533 #if defined(ENABLE_SETTINGS_APP) | 542 #if defined(ENABLE_SETTINGS_APP) |
534 Add(IDR_SETTINGS_APP_MANIFEST, | 543 Add(IDR_SETTINGS_APP_MANIFEST, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 659 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
651 storage::FileSystemContext* file_system_context = | 660 storage::FileSystemContext* file_system_context = |
652 content::BrowserContext::GetStoragePartitionForSite( | 661 content::BrowserContext::GetStoragePartitionForSite( |
653 off_the_record_context, site)->GetFileSystemContext(); | 662 off_the_record_context, site)->GetFileSystemContext(); |
654 file_system_context->EnableTemporaryFileSystemInIncognito(); | 663 file_system_context->EnableTemporaryFileSystemInIncognito(); |
655 } | 664 } |
656 #endif | 665 #endif |
657 } | 666 } |
658 | 667 |
659 } // namespace extensions | 668 } // namespace extensions |
OLD | NEW |