Chromium Code Reviews| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 | 432 |
| 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. |
|
hashimoto
2014/03/25 07:47:37
nit: We need the same comment here?
yoshiki
2014/03/25 08:36:46
Done.
| |
| 443 AddVideoPlayerExtension(); | |
| 443 AddFileManagerExtension(); | 444 AddFileManagerExtension(); |
| 444 AddVideoPlayerExtension(); | |
| 445 | 445 |
| 446 // Add virtual keyboard. | 446 // Add virtual keyboard. |
| 447 AddKeyboardApp(); | 447 AddKeyboardApp(); |
| 448 } | 448 } |
| 449 | 449 |
| 450 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( | 450 void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
| 451 bool skip_session_components) { | 451 bool skip_session_components) { |
| 452 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 452 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 453 | 453 |
| 454 // Component extensions with background pages are not enabled during tests | 454 // Component extensions with background pages are not enabled during tests |
| 455 // because they generate a lot of background behavior that can interfere. | 455 // because they generate a lot of background behavior that can interfere. |
| 456 if (!enable_background_extensions_during_testing && | 456 if (!enable_background_extensions_during_testing && |
| 457 (command_line->HasSwitch(switches::kTestType) || | 457 (command_line->HasSwitch(switches::kTestType) || |
| 458 command_line->HasSwitch( | 458 command_line->HasSwitch( |
| 459 switches::kDisableComponentExtensionsWithBackgroundPages))) { | 459 switches::kDisableComponentExtensionsWithBackgroundPages))) { |
| 460 return; | 460 return; |
| 461 } | 461 } |
| 462 | 462 |
| 463 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) | 463 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) |
| 464 // Since this is a v2 app it has a background page. | 464 // Since this is a v2 app it has a background page. |
| 465 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { | 465 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { |
| 466 AddWithName(IDR_GENIUS_APP_MANIFEST, | 466 AddWithName(IDR_GENIUS_APP_MANIFEST, |
| 467 base::FilePath(FILE_PATH_LITERAL( | 467 base::FilePath(FILE_PATH_LITERAL( |
| 468 "/usr/share/chromeos-assets/genius_app")), | 468 "/usr/share/chromeos-assets/genius_app")), |
| 469 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); | 469 l10n_util::GetStringUTF8(IDS_GENIUS_APP_NAME)); |
| 470 } | 470 } |
| 471 #endif | 471 #endif |
| 472 | 472 |
| 473 if (!skip_session_components) { | 473 if (!skip_session_components) { |
| 474 // Video player should be avove the file manager, since the video player | |
| 475 // is the default app for video files by default. | |
| 476 AddVideoPlayerExtension(); | |
| 474 AddFileManagerExtension(); | 477 AddFileManagerExtension(); |
| 475 AddVideoPlayerExtension(); | 478 |
| 476 AddHangoutServicesExtension(); | 479 AddHangoutServicesExtension(); |
| 477 AddHotwordHelperExtension(); | 480 AddHotwordHelperExtension(); |
| 478 AddImageLoaderExtension(); | 481 AddImageLoaderExtension(); |
| 479 | 482 |
| 480 #if defined(ENABLE_SETTINGS_APP) | 483 #if defined(ENABLE_SETTINGS_APP) |
| 481 Add(IDR_SETTINGS_APP_MANIFEST, | 484 Add(IDR_SETTINGS_APP_MANIFEST, |
| 482 base::FilePath(FILE_PATH_LITERAL("settings_app"))); | 485 base::FilePath(FILE_PATH_LITERAL("settings_app"))); |
| 483 #endif | 486 #endif |
| 484 } | 487 } |
| 485 | 488 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 616 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| 614 fileapi::FileSystemContext* file_system_context = | 617 fileapi::FileSystemContext* file_system_context = |
| 615 content::BrowserContext::GetStoragePartitionForSite( | 618 content::BrowserContext::GetStoragePartitionForSite( |
| 616 off_the_record_context, site)->GetFileSystemContext(); | 619 off_the_record_context, site)->GetFileSystemContext(); |
| 617 file_system_context->EnableTemporaryFileSystemInIncognito(); | 620 file_system_context->EnableTemporaryFileSystemInIncognito(); |
| 618 } | 621 } |
| 619 #endif | 622 #endif |
| 620 } | 623 } |
| 621 | 624 |
| 622 } // namespace extensions | 625 } // namespace extensions |
| OLD | NEW |