| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 Add(IDR_FILEMANAGER_MANIFEST, | 285 Add(IDR_FILEMANAGER_MANIFEST, |
| 286 base::FilePath(FILE_PATH_LITERAL("file_manager"))); | 286 base::FilePath(FILE_PATH_LITERAL("file_manager"))); |
| 287 #endif // defined(OS_CHROMEOS) | 287 #endif // defined(OS_CHROMEOS) |
| 288 } | 288 } |
| 289 | 289 |
| 290 void ComponentLoader::AddVideoPlayerExtension() { | 290 void ComponentLoader::AddVideoPlayerExtension() { |
| 291 Add(IDR_VIDEOPLAYER_MANIFEST, | 291 Add(IDR_VIDEOPLAYER_MANIFEST, |
| 292 base::FilePath(FILE_PATH_LITERAL("video_player"))); | 292 base::FilePath(FILE_PATH_LITERAL("video_player"))); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void ComponentLoader::AddGalleryExtension() { |
| 296 #if defined(OS_CHROMEOS) |
| 297 const CommandLine* const command_line = CommandLine::ForCurrentProcess(); |
| 298 if (command_line->HasSwitch(chromeos::switches::kFileManagerEnableNewGallery)) |
| 299 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery"))); |
| 300 #endif |
| 301 } |
| 302 |
| 295 void ComponentLoader::AddHangoutServicesExtension() { | 303 void ComponentLoader::AddHangoutServicesExtension() { |
| 296 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) | 304 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) |
| 297 Add(IDR_HANGOUT_SERVICES_MANIFEST, | 305 Add(IDR_HANGOUT_SERVICES_MANIFEST, |
| 298 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); | 306 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); |
| 299 #endif | 307 #endif |
| 300 } | 308 } |
| 301 | 309 |
| 302 void ComponentLoader::AddHotwordHelperExtension() { | 310 void ComponentLoader::AddHotwordHelperExtension() { |
| 303 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { | 311 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { |
| 304 Add(IDR_HOTWORD_HELPER_MANIFEST, | 312 Add(IDR_HOTWORD_HELPER_MANIFEST, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 443 |
| 436 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( | 444 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( |
| 437 bool skip_session_components) { | 445 bool skip_session_components) { |
| 438 // No component extension for kiosk app launch splash screen. | 446 // No component extension for kiosk app launch splash screen. |
| 439 if (skip_session_components) | 447 if (skip_session_components) |
| 440 return; | 448 return; |
| 441 | 449 |
| 442 // Component extensions needed for kiosk apps. | 450 // Component extensions needed for kiosk apps. |
| 443 AddVideoPlayerExtension(); | 451 AddVideoPlayerExtension(); |
| 444 AddFileManagerExtension(); | 452 AddFileManagerExtension(); |
| 453 AddGalleryExtension(); |
| 445 | 454 |
| 446 // Add virtual keyboard. | 455 // Add virtual keyboard. |
| 447 AddKeyboardApp(); | 456 AddKeyboardApp(); |
| 448 } | 457 } |
| 449 | 458 |
| 450 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( | 459 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
| 451 bool skip_session_components) { | 460 bool skip_session_components) { |
| 452 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 461 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 453 | 462 |
| 454 // Component extensions with background pages are not enabled during tests | 463 // Component extensions with background pages are not enabled during tests |
| (...skipping 11 matching lines...) Expand all Loading... |
| 466 AddWithName(IDR_GENIUS_APP_MANIFEST, | 475 AddWithName(IDR_GENIUS_APP_MANIFEST, |
| 467 base::FilePath(FILE_PATH_LITERAL( | 476 base::FilePath(FILE_PATH_LITERAL( |
| 468 "/usr/share/chromeos-assets/genius_app")), | 477 "/usr/share/chromeos-assets/genius_app")), |
| 469 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); | 478 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); |
| 470 } | 479 } |
| 471 #endif | 480 #endif |
| 472 | 481 |
| 473 if (!skip_session_components) { | 482 if (!skip_session_components) { |
| 474 AddVideoPlayerExtension(); | 483 AddVideoPlayerExtension(); |
| 475 AddFileManagerExtension(); | 484 AddFileManagerExtension(); |
| 485 AddGalleryExtension(); |
| 476 | 486 |
| 477 AddHangoutServicesExtension(); | 487 AddHangoutServicesExtension(); |
| 478 AddHotwordHelperExtension(); | 488 AddHotwordHelperExtension(); |
| 479 AddImageLoaderExtension(); | 489 AddImageLoaderExtension(); |
| 480 | 490 |
| 481 #if defined(ENABLE_SETTINGS_APP) | 491 #if defined(ENABLE_SETTINGS_APP) |
| 482 Add(IDR_SETTINGS_APP_MANIFEST, | 492 Add(IDR_SETTINGS_APP_MANIFEST, |
| 483 base::FilePath(FILE_PATH_LITERAL("settings_app"))); | 493 base::FilePath(FILE_PATH_LITERAL("settings_app"))); |
| 484 #endif | 494 #endif |
| 485 } | 495 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 625 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| 616 fileapi::FileSystemContext* file_system_context = | 626 fileapi::FileSystemContext* file_system_context = |
| 617 content::BrowserContext::GetStoragePartitionForSite( | 627 content::BrowserContext::GetStoragePartitionForSite( |
| 618 off_the_record_context, site)->GetFileSystemContext(); | 628 off_the_record_context, site)->GetFileSystemContext(); |
| 619 file_system_context->EnableTemporaryFileSystemInIncognito(); | 629 file_system_context->EnableTemporaryFileSystemInIncognito(); |
| 620 } | 630 } |
| 621 #endif | 631 #endif |
| 622 } | 632 } |
| 623 | 633 |
| 624 } // namespace extensions | 634 } // namespace extensions |
| OLD | NEW |