| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); | 280 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); |
| 281 Add(IDR_FILEMANAGER_MANIFEST, filemgr_extension_path); | 281 Add(IDR_FILEMANAGER_MANIFEST, filemgr_extension_path); |
| 282 return; | 282 return; |
| 283 } | 283 } |
| 284 #endif // NDEBUG | 284 #endif // NDEBUG |
| 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() { |
| 291 Add(IDR_VIDEOPLAYER_MANIFEST, |
| 292 base::FilePath(FILE_PATH_LITERAL("video_player"))); |
| 293 } |
| 294 |
| 290 void ComponentLoader::AddHangoutServicesExtension() { | 295 void ComponentLoader::AddHangoutServicesExtension() { |
| 291 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) | 296 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) |
| 292 Add(IDR_HANGOUT_SERVICES_MANIFEST, | 297 Add(IDR_HANGOUT_SERVICES_MANIFEST, |
| 293 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); | 298 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); |
| 294 #endif | 299 #endif |
| 295 } | 300 } |
| 296 | 301 |
| 297 void ComponentLoader::AddHotwordHelperExtension() { | 302 void ComponentLoader::AddHotwordHelperExtension() { |
| 298 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { | 303 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { |
| 299 Add(IDR_HOTWORD_HELPER_MANIFEST, | 304 Add(IDR_HOTWORD_HELPER_MANIFEST, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 } | 434 } |
| 430 | 435 |
| 431 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( | 436 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( |
| 432 bool skip_session_components) { | 437 bool skip_session_components) { |
| 433 // No component extension for kiosk app launch splash screen. | 438 // No component extension for kiosk app launch splash screen. |
| 434 if (skip_session_components) | 439 if (skip_session_components) |
| 435 return; | 440 return; |
| 436 | 441 |
| 437 // Component extensions needed for kiosk apps. | 442 // Component extensions needed for kiosk apps. |
| 438 AddFileManagerExtension(); | 443 AddFileManagerExtension(); |
| 444 AddVideoPlayerExtension(); |
| 439 | 445 |
| 440 // Add virtual keyboard. | 446 // Add virtual keyboard. |
| 441 AddKeyboardApp(); | 447 AddKeyboardApp(); |
| 442 } | 448 } |
| 443 | 449 |
| 444 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( | 450 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
| 445 bool skip_session_components) { | 451 bool skip_session_components) { |
| 446 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 452 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 447 | 453 |
| 448 // Component extensions with background pages are not enabled during tests | 454 // Component extensions with background pages are not enabled during tests |
| (...skipping 10 matching lines...) Expand all Loading... |
| 459 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { | 465 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { |
| 460 AddWithName(IDR_GENIUS_APP_MANIFEST, | 466 AddWithName(IDR_GENIUS_APP_MANIFEST, |
| 461 base::FilePath(FILE_PATH_LITERAL( | 467 base::FilePath(FILE_PATH_LITERAL( |
| 462 "/usr/share/chromeos-assets/genius_app")), | 468 "/usr/share/chromeos-assets/genius_app")), |
| 463 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); | 469 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); |
| 464 } | 470 } |
| 465 #endif | 471 #endif |
| 466 | 472 |
| 467 if (!skip_session_components) { | 473 if (!skip_session_components) { |
| 468 AddFileManagerExtension(); | 474 AddFileManagerExtension(); |
| 475 AddVideoPlayerExtension(); |
| 469 AddHangoutServicesExtension(); | 476 AddHangoutServicesExtension(); |
| 470 AddHotwordHelperExtension(); | 477 AddHotwordHelperExtension(); |
| 471 AddImageLoaderExtension(); | 478 AddImageLoaderExtension(); |
| 472 | 479 |
| 473 #if defined(ENABLE_SETTINGS_APP) | 480 #if defined(ENABLE_SETTINGS_APP) |
| 474 Add(IDR_SETTINGS_APP_MANIFEST, | 481 Add(IDR_SETTINGS_APP_MANIFEST, |
| 475 base::FilePath(FILE_PATH_LITERAL("settings_app"))); | 482 base::FilePath(FILE_PATH_LITERAL("settings_app"))); |
| 476 #endif | 483 #endif |
| 477 } | 484 } |
| 478 | 485 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 613 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| 607 fileapi::FileSystemContext* file_system_context = | 614 fileapi::FileSystemContext* file_system_context = |
| 608 content::BrowserContext::GetStoragePartitionForSite( | 615 content::BrowserContext::GetStoragePartitionForSite( |
| 609 off_the_record_context, site)->GetFileSystemContext(); | 616 off_the_record_context, site)->GetFileSystemContext(); |
| 610 file_system_context->EnableTemporaryFileSystemInIncognito(); | 617 file_system_context->EnableTemporaryFileSystemInIncognito(); |
| 611 } | 618 } |
| 612 #endif | 619 #endif |
| 613 } | 620 } |
| 614 | 621 |
| 615 } // namespace extensions | 622 } // namespace extensions |
| OLD | NEW |