Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/extensions/component_loader.cc

Issue 467073002: Only initialize the input method list for once, no need to re-initialize for each profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
46 #include "content/public/browser/site_instance.h" 45 #include "content/public/browser/site_instance.h"
47 #include "content/public/browser/storage_partition.h" 46 #include "content/public/browser/storage_partition.h"
48 #include "extensions/browser/extensions_browser_client.h" 47 #include "extensions/browser/extensions_browser_client.h"
49 #include "webkit/browser/fileapi/file_system_context.h" 48 #include "webkit/browser/fileapi/file_system_context.h"
50 #endif 49 #endif
51 50
52 #if defined(ENABLE_APP_LIST) 51 #if defined(ENABLE_APP_LIST)
53 #include "grit/chromium_strings.h" 52 #include "grit/chromium_strings.h"
54 #endif 53 #endif
55 54
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // static 419 // static
421 void ComponentLoader::EnableBackgroundExtensionsForTesting() { 420 void ComponentLoader::EnableBackgroundExtensionsForTesting() {
422 enable_background_extensions_during_testing = true; 421 enable_background_extensions_during_testing = true;
423 } 422 }
424 423
425 void ComponentLoader::AddDefaultComponentExtensions( 424 void ComponentLoader::AddDefaultComponentExtensions(
426 bool skip_session_components) { 425 bool skip_session_components) {
427 // 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
428 // to AddDefaultComponentExtensionsWithBackgroundPages. 427 // to AddDefaultComponentExtensionsWithBackgroundPages.
429 #if defined(OS_CHROMEOS) 428 #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
435 Add(IDR_MOBILE_MANIFEST, 429 Add(IDR_MOBILE_MANIFEST,
436 base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile"))); 430 base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile")));
437 431
438 #if defined(GOOGLE_CHROME_BUILD) 432 #if defined(GOOGLE_CHROME_BUILD)
439 if (browser_defaults::enable_help_app) { 433 if (browser_defaults::enable_help_app) {
440 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( 434 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL(
441 "/usr/share/chromeos-assets/helpapp"))); 435 "/usr/share/chromeos-assets/helpapp")));
442 } 436 }
443 #endif 437 #endif
444 438
(...skipping 21 matching lines...) Expand all
466 AddChromeApp(); 460 AddChromeApp();
467 } 461 }
468 462
469 AddKeyboardApp(); 463 AddKeyboardApp();
470 464
471 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components); 465 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components);
472 } 466 }
473 467
474 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( 468 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode(
475 bool skip_session_components) { 469 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
482 // No component extension for kiosk app launch splash screen. 470 // No component extension for kiosk app launch splash screen.
483 if (skip_session_components) 471 if (skip_session_components)
484 return; 472 return;
485 473
486 // Component extensions needed for kiosk apps. 474 // Component extensions needed for kiosk apps.
487 AddVideoPlayerExtension(); 475 AddVideoPlayerExtension();
488 AddFileManagerExtension(); 476 AddFileManagerExtension();
489 AddGalleryExtension(); 477 AddGalleryExtension();
490 478
491 // Add virtual keyboard. 479 // Add virtual keyboard.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); 633 off_the_record_context, Extension::GetBaseURLFromExtensionId(id));
646 fileapi::FileSystemContext* file_system_context = 634 fileapi::FileSystemContext* file_system_context =
647 content::BrowserContext::GetStoragePartitionForSite( 635 content::BrowserContext::GetStoragePartitionForSite(
648 off_the_record_context, site)->GetFileSystemContext(); 636 off_the_record_context, site)->GetFileSystemContext();
649 file_system_context->EnableTemporaryFileSystemInIncognito(); 637 file_system_context->EnableTemporaryFileSystemInIncognito();
650 } 638 }
651 #endif 639 #endif
652 } 640 }
653 641
654 } // namespace extensions 642 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/mock_input_method_manager.cc ('k') | chromeos/ime/input_method_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698