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