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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components); | 433 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components); |
434 } | 434 } |
435 | 435 |
436 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( | 436 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( |
437 bool skip_session_components) { | 437 bool skip_session_components) { |
438 // No component extension for kiosk app launch splash screen. | 438 // No component extension for kiosk app launch splash screen. |
439 if (skip_session_components) | 439 if (skip_session_components) |
440 return; | 440 return; |
441 | 441 |
442 // Component extensions needed for kiosk apps. | 442 // Component extensions needed for kiosk apps. |
| 443 // Note: Video player should be avove the file manager, since the video |
| 444 // player is the default app for video files by default. |
| 445 AddVideoPlayerExtension(); |
443 AddFileManagerExtension(); | 446 AddFileManagerExtension(); |
444 AddVideoPlayerExtension(); | |
445 | 447 |
446 // Add virtual keyboard. | 448 // Add virtual keyboard. |
447 AddKeyboardApp(); | 449 AddKeyboardApp(); |
448 } | 450 } |
449 | 451 |
450 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( | 452 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
451 bool skip_session_components) { | 453 bool skip_session_components) { |
452 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 454 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
453 | 455 |
454 // Component extensions with background pages are not enabled during tests | 456 // Component extensions with background pages are not enabled during tests |
455 // because they generate a lot of background behavior that can interfere. | 457 // because they generate a lot of background behavior that can interfere. |
456 if (!enable_background_extensions_during_testing && | 458 if (!enable_background_extensions_during_testing && |
457 (command_line->HasSwitch(switches::kTestType) || | 459 (command_line->HasSwitch(switches::kTestType) || |
458 command_line->HasSwitch( | 460 command_line->HasSwitch( |
459 switches::kDisableComponentExtensionsWithBackgroundPages))) { | 461 switches::kDisableComponentExtensionsWithBackgroundPages))) { |
460 return; | 462 return; |
461 } | 463 } |
462 | 464 |
463 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) | 465 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) |
464 // Since this is a v2 app it has a background page. | 466 // Since this is a v2 app it has a background page. |
465 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { | 467 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { |
466 AddWithName(IDR_GENIUS_APP_MANIFEST, | 468 AddWithName(IDR_GENIUS_APP_MANIFEST, |
467 base::FilePath(FILE_PATH_LITERAL( | 469 base::FilePath(FILE_PATH_LITERAL( |
468 "/usr/share/chromeos-assets/genius_app")), | 470 "/usr/share/chromeos-assets/genius_app")), |
469 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); | 471 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); |
470 } | 472 } |
471 #endif | 473 #endif |
472 | 474 |
473 if (!skip_session_components) { | 475 if (!skip_session_components) { |
| 476 // Note: Video player should be avove the file manager, since the video |
| 477 // player is the default app for video files by default. |
| 478 AddVideoPlayerExtension(); |
474 AddFileManagerExtension(); | 479 AddFileManagerExtension(); |
475 AddVideoPlayerExtension(); | 480 |
476 AddHangoutServicesExtension(); | 481 AddHangoutServicesExtension(); |
477 AddHotwordHelperExtension(); | 482 AddHotwordHelperExtension(); |
478 AddImageLoaderExtension(); | 483 AddImageLoaderExtension(); |
479 | 484 |
480 #if defined(ENABLE_SETTINGS_APP) | 485 #if defined(ENABLE_SETTINGS_APP) |
481 Add(IDR_SETTINGS_APP_MANIFEST, | 486 Add(IDR_SETTINGS_APP_MANIFEST, |
482 base::FilePath(FILE_PATH_LITERAL("settings_app"))); | 487 base::FilePath(FILE_PATH_LITERAL("settings_app"))); |
483 #endif | 488 #endif |
484 } | 489 } |
485 | 490 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 618 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
614 fileapi::FileSystemContext* file_system_context = | 619 fileapi::FileSystemContext* file_system_context = |
615 content::BrowserContext::GetStoragePartitionForSite( | 620 content::BrowserContext::GetStoragePartitionForSite( |
616 off_the_record_context, site)->GetFileSystemContext(); | 621 off_the_record_context, site)->GetFileSystemContext(); |
617 file_system_context->EnableTemporaryFileSystemInIncognito(); | 622 file_system_context->EnableTemporaryFileSystemInIncognito(); |
618 } | 623 } |
619 #endif | 624 #endif |
620 } | 625 } |
621 | 626 |
622 } // namespace extensions | 627 } // namespace extensions |
OLD | NEW |