| 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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/extensions/browser_event_router.h" | 39 #include "chrome/browser/extensions/browser_event_router.h" |
| 40 #include "chrome/browser/extensions/component_loader.h" | 40 #include "chrome/browser/extensions/component_loader.h" |
| 41 #include "chrome/browser/extensions/crx_installer.h" | 41 #include "chrome/browser/extensions/crx_installer.h" |
| 42 #include "chrome/browser/extensions/default_apps_trial.h" | 42 #include "chrome/browser/extensions/default_apps_trial.h" |
| 43 #include "chrome/browser/extensions/extension_data_deleter.h" | 43 #include "chrome/browser/extensions/extension_data_deleter.h" |
| 44 #include "chrome/browser/extensions/extension_disabled_ui.h" | 44 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 45 #include "chrome/browser/extensions/extension_error_reporter.h" | 45 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 46 #include "chrome/browser/extensions/extension_error_ui.h" | 46 #include "chrome/browser/extensions/extension_error_ui.h" |
| 47 #include "chrome/browser/extensions/extension_font_settings_api.h" | 47 #include "chrome/browser/extensions/extension_font_settings_api.h" |
| 48 #include "chrome/browser/extensions/extension_host.h" | 48 #include "chrome/browser/extensions/extension_host.h" |
| 49 #include "chrome/browser/extensions/extension_input_ime_api.h" | |
| 50 #include "chrome/browser/extensions/extension_install_ui.h" | 49 #include "chrome/browser/extensions/extension_install_ui.h" |
| 51 #include "chrome/browser/extensions/extension_management_api.h" | 50 #include "chrome/browser/extensions/extension_management_api.h" |
| 52 #include "chrome/browser/extensions/extension_preference_api.h" | 51 #include "chrome/browser/extensions/extension_preference_api.h" |
| 53 #include "chrome/browser/extensions/extension_process_manager.h" | 52 #include "chrome/browser/extensions/extension_process_manager.h" |
| 54 #include "chrome/browser/extensions/extension_processes_api.h" | 53 #include "chrome/browser/extensions/extension_processes_api.h" |
| 55 #include "chrome/browser/extensions/extension_sorting.h" | 54 #include "chrome/browser/extensions/extension_sorting.h" |
| 56 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 55 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 57 #include "chrome/browser/extensions/extension_sync_data.h" | 56 #include "chrome/browser/extensions/extension_sync_data.h" |
| 58 #include "chrome/browser/extensions/extension_system.h" | 57 #include "chrome/browser/extensions/extension_system.h" |
| 59 #include "chrome/browser/extensions/extension_web_ui.h" | 58 #include "chrome/browser/extensions/extension_web_ui.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 #include "webkit/database/database_tracker.h" | 107 #include "webkit/database/database_tracker.h" |
| 109 #include "webkit/database/database_util.h" | 108 #include "webkit/database/database_util.h" |
| 110 | 109 |
| 111 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) |
| 112 #include "chrome/browser/chromeos/cros/cros_library.h" | 111 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 113 #include "chrome/browser/chromeos/extensions/bluetooth_event_router.h" | 112 #include "chrome/browser/chromeos/extensions/bluetooth_event_router.h" |
| 114 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" | 113 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
| 115 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" | 114 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" |
| 116 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 115 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
| 117 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 116 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 118 #include "chrome/browser/extensions/extension_input_ime_api.h" | 117 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h" |
| 119 #include "webkit/fileapi/file_system_context.h" | 118 #include "webkit/fileapi/file_system_context.h" |
| 120 #include "webkit/fileapi/file_system_mount_point_provider.h" | 119 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| 121 #endif | 120 #endif |
| 122 | 121 |
| 123 using base::Time; | 122 using base::Time; |
| 124 using content::BrowserContext; | 123 using content::BrowserContext; |
| 125 using content::BrowserThread; | 124 using content::BrowserThread; |
| 126 using content::DevToolsAgentHost; | 125 using content::DevToolsAgentHost; |
| 127 using content::DevToolsAgentHostRegistry; | 126 using content::DevToolsAgentHostRegistry; |
| 128 using content::PluginService; | 127 using content::PluginService; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 FileBrowserEventRouterFactory::GetForProfile( | 495 FileBrowserEventRouterFactory::GetForProfile( |
| 497 profile_)->ObserveFileSystemEvents(); | 496 profile_)->ObserveFileSystemEvents(); |
| 498 | 497 |
| 499 bluetooth_event_router_.reset( | 498 bluetooth_event_router_.reset( |
| 500 new chromeos::ExtensionBluetoothEventRouter(profile_)); | 499 new chromeos::ExtensionBluetoothEventRouter(profile_)); |
| 501 | 500 |
| 502 input_method_event_router_.reset( | 501 input_method_event_router_.reset( |
| 503 new chromeos::ExtensionInputMethodEventRouter); | 502 new chromeos::ExtensionInputMethodEventRouter); |
| 504 | 503 |
| 505 ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_); | 504 ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_); |
| 506 ExtensionInputImeEventRouter::GetInstance()->Init(); | 505 extensions::InputImeEventRouter::GetInstance()->Init(); |
| 507 #endif | 506 #endif |
| 508 #endif // defined(ENABLE_EXTENSIONS) | 507 #endif // defined(ENABLE_EXTENSIONS) |
| 509 event_routers_initialized_ = true; | 508 event_routers_initialized_ = true; |
| 510 } | 509 } |
| 511 | 510 |
| 512 const Extension* ExtensionService::GetExtensionById( | 511 const Extension* ExtensionService::GetExtensionById( |
| 513 const std::string& id, bool include_disabled) const { | 512 const std::string& id, bool include_disabled) const { |
| 514 return GetExtensionByIdInternal(id, true, include_disabled, false); | 513 return GetExtensionByIdInternal(id, true, include_disabled, false); |
| 515 } | 514 } |
| 516 | 515 |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 | 1021 |
| 1023 if (plugins_changed || nacl_modules_changed) | 1022 if (plugins_changed || nacl_modules_changed) |
| 1024 PluginService::GetInstance()->PurgePluginListCache(profile_, false); | 1023 PluginService::GetInstance()->PurgePluginListCache(profile_, false); |
| 1025 | 1024 |
| 1026 #if defined(OS_CHROMEOS) | 1025 #if defined(OS_CHROMEOS) |
| 1027 for (std::vector<Extension::InputComponentInfo>::const_iterator component = | 1026 for (std::vector<Extension::InputComponentInfo>::const_iterator component = |
| 1028 extension->input_components().begin(); | 1027 extension->input_components().begin(); |
| 1029 component != extension->input_components().end(); | 1028 component != extension->input_components().end(); |
| 1030 ++component) { | 1029 ++component) { |
| 1031 if (component->type == Extension::INPUT_COMPONENT_TYPE_IME) { | 1030 if (component->type == Extension::INPUT_COMPONENT_TYPE_IME) { |
| 1032 ExtensionInputImeEventRouter::GetInstance()->RegisterIme( | 1031 extensions::InputImeEventRouter::GetInstance()->RegisterIme( |
| 1033 profile_, extension->id(), *component); | 1032 profile_, extension->id(), *component); |
| 1034 } | 1033 } |
| 1035 } | 1034 } |
| 1036 #endif | 1035 #endif |
| 1037 } | 1036 } |
| 1038 | 1037 |
| 1039 void ExtensionService::NotifyExtensionUnloaded( | 1038 void ExtensionService::NotifyExtensionUnloaded( |
| 1040 const Extension* extension, | 1039 const Extension* extension, |
| 1041 extension_misc::UnloadedExtensionReason reason) { | 1040 extension_misc::UnloadedExtensionReason reason) { |
| 1042 UnloadedExtensionInfo details(extension, reason); | 1041 UnloadedExtensionInfo details(extension, reason); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1064 | 1063 |
| 1065 #if defined(OS_CHROMEOS) | 1064 #if defined(OS_CHROMEOS) |
| 1066 // Revoke external file access to | 1065 // Revoke external file access to |
| 1067 if (BrowserContext::GetFileSystemContext(profile_) && | 1066 if (BrowserContext::GetFileSystemContext(profile_) && |
| 1068 BrowserContext::GetFileSystemContext(profile_)->external_provider()) { | 1067 BrowserContext::GetFileSystemContext(profile_)->external_provider()) { |
| 1069 BrowserContext::GetFileSystemContext(profile_)->external_provider()-> | 1068 BrowserContext::GetFileSystemContext(profile_)->external_provider()-> |
| 1070 RevokeAccessForExtension(extension->id()); | 1069 RevokeAccessForExtension(extension->id()); |
| 1071 } | 1070 } |
| 1072 | 1071 |
| 1073 if (extension->input_components().size() > 0) { | 1072 if (extension->input_components().size() > 0) { |
| 1074 ExtensionInputImeEventRouter::GetInstance()->UnregisterAllImes( | 1073 extensions::InputImeEventRouter::GetInstance()->UnregisterAllImes( |
| 1075 profile_, extension->id()); | 1074 profile_, extension->id()); |
| 1076 } | 1075 } |
| 1077 #endif | 1076 #endif |
| 1078 | 1077 |
| 1079 UpdateActiveExtensionsInCrashReporter(); | 1078 UpdateActiveExtensionsInCrashReporter(); |
| 1080 | 1079 |
| 1081 bool plugins_changed = false; | 1080 bool plugins_changed = false; |
| 1082 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 1081 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
| 1083 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 1082 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
| 1084 PluginService::GetInstance()->ForcePluginShutdown(plugin.path); | 1083 PluginService::GetInstance()->ForcePluginShutdown(plugin.path); |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2536 | 2535 |
| 2537 ExtensionService::NaClModuleInfoList::iterator | 2536 ExtensionService::NaClModuleInfoList::iterator |
| 2538 ExtensionService::FindNaClModule(const GURL& url) { | 2537 ExtensionService::FindNaClModule(const GURL& url) { |
| 2539 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2538 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2540 iter != nacl_module_list_.end(); ++iter) { | 2539 iter != nacl_module_list_.end(); ++iter) { |
| 2541 if (iter->url == url) | 2540 if (iter->url == url) |
| 2542 return iter; | 2541 return iter; |
| 2543 } | 2542 } |
| 2544 return nacl_module_list_.end(); | 2543 return nacl_module_list_.end(); |
| 2545 } | 2544 } |
| OLD | NEW |