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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #endif | 34 #endif |
35 | 35 |
36 #if defined(GOOGLE_CHROME_BUILD) | 36 #if defined(GOOGLE_CHROME_BUILD) |
37 #include "chrome/browser/defaults.h" | 37 #include "chrome/browser/defaults.h" |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
41 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 41 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
42 #include "chrome/browser/chromeos/login/users/user_manager.h" | 42 #include "chrome/browser/chromeos/login/users/user_manager.h" |
43 #include "chromeos/chromeos_switches.h" | 43 #include "chromeos/chromeos_switches.h" |
| 44 #include "chromeos/ime/input_method_manager.h" |
44 #include "content/public/browser/site_instance.h" | 45 #include "content/public/browser/site_instance.h" |
45 #include "content/public/browser/storage_partition.h" | 46 #include "content/public/browser/storage_partition.h" |
46 #include "extensions/browser/extensions_browser_client.h" | 47 #include "extensions/browser/extensions_browser_client.h" |
47 #include "webkit/browser/fileapi/file_system_context.h" | 48 #include "webkit/browser/fileapi/file_system_context.h" |
48 #endif | 49 #endif |
49 | 50 |
50 #if defined(ENABLE_APP_LIST) | 51 #if defined(ENABLE_APP_LIST) |
51 #include "grit/chromium_strings.h" | 52 #include "grit/chromium_strings.h" |
52 #endif | 53 #endif |
53 | 54 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // static | 419 // static |
419 void ComponentLoader::EnableBackgroundExtensionsForTesting() { | 420 void ComponentLoader::EnableBackgroundExtensionsForTesting() { |
420 enable_background_extensions_during_testing = true; | 421 enable_background_extensions_during_testing = true; |
421 } | 422 } |
422 | 423 |
423 void ComponentLoader::AddDefaultComponentExtensions( | 424 void ComponentLoader::AddDefaultComponentExtensions( |
424 bool skip_session_components) { | 425 bool skip_session_components) { |
425 // Do not add component extensions that have background pages here -- add them | 426 // Do not add component extensions that have background pages here -- add them |
426 // to AddDefaultComponentExtensionsWithBackgroundPages. | 427 // to AddDefaultComponentExtensionsWithBackgroundPages. |
427 #if defined(OS_CHROMEOS) | 428 #if defined(OS_CHROMEOS) |
| 429 chromeos::input_method::InputMethodManager* input_method_manager = |
| 430 chromeos::input_method::InputMethodManager::Get(); |
| 431 if (input_method_manager) |
| 432 input_method_manager->InitializeComponentExtension(); |
| 433 |
428 Add(IDR_MOBILE_MANIFEST, | 434 Add(IDR_MOBILE_MANIFEST, |
429 base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile"))); | 435 base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile"))); |
430 | 436 |
431 #if defined(GOOGLE_CHROME_BUILD) | 437 #if defined(GOOGLE_CHROME_BUILD) |
432 if (browser_defaults::enable_help_app) { | 438 if (browser_defaults::enable_help_app) { |
433 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 439 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
434 "/usr/share/chromeos-assets/helpapp"))); | 440 "/usr/share/chromeos-assets/helpapp"))); |
435 } | 441 } |
436 #endif | 442 #endif |
437 | 443 |
(...skipping 21 matching lines...) Expand all Loading... |
459 AddChromeApp(); | 465 AddChromeApp(); |
460 } | 466 } |
461 | 467 |
462 AddKeyboardApp(); | 468 AddKeyboardApp(); |
463 | 469 |
464 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components); | 470 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components); |
465 } | 471 } |
466 | 472 |
467 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( | 473 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( |
468 bool skip_session_components) { | 474 bool skip_session_components) { |
| 475 #if defined(OS_CHROMEOS) |
| 476 chromeos::input_method::InputMethodManager* input_method_manager = |
| 477 chromeos::input_method::InputMethodManager::Get(); |
| 478 if (input_method_manager) |
| 479 input_method_manager->InitializeComponentExtension(); |
| 480 #endif |
469 // No component extension for kiosk app launch splash screen. | 481 // No component extension for kiosk app launch splash screen. |
470 if (skip_session_components) | 482 if (skip_session_components) |
471 return; | 483 return; |
472 | 484 |
473 // Component extensions needed for kiosk apps. | 485 // Component extensions needed for kiosk apps. |
474 AddVideoPlayerExtension(); | 486 AddVideoPlayerExtension(); |
475 AddFileManagerExtension(); | 487 AddFileManagerExtension(); |
476 AddGalleryExtension(); | 488 AddGalleryExtension(); |
477 | 489 |
478 // Add virtual keyboard. | 490 // Add virtual keyboard. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 658 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
647 fileapi::FileSystemContext* file_system_context = | 659 fileapi::FileSystemContext* file_system_context = |
648 content::BrowserContext::GetStoragePartitionForSite( | 660 content::BrowserContext::GetStoragePartitionForSite( |
649 off_the_record_context, site)->GetFileSystemContext(); | 661 off_the_record_context, site)->GetFileSystemContext(); |
650 file_system_context->EnableTemporaryFileSystemInIncognito(); | 662 file_system_context->EnableTemporaryFileSystemInIncognito(); |
651 } | 663 } |
652 #endif | 664 #endif |
653 } | 665 } |
654 | 666 |
655 } // namespace extensions | 667 } // namespace extensions |
OLD | NEW |