| 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_system.h" | 5 #include "chrome/browser/extensions/extension_system.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" | 22 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" |
| 23 #include "chrome/browser/extensions/extension_prefs.h" | 23 #include "chrome/browser/extensions/extension_prefs.h" |
| 24 #include "chrome/browser/extensions/extension_process_manager.h" | 24 #include "chrome/browser/extensions/extension_process_manager.h" |
| 25 #include "chrome/browser/extensions/extension_service.h" | 25 #include "chrome/browser/extensions/extension_service.h" |
| 26 #include "chrome/browser/extensions/extension_system_factory.h" | 26 #include "chrome/browser/extensions/extension_system_factory.h" |
| 27 #include "chrome/browser/extensions/extension_warning_badge_service.h" | 27 #include "chrome/browser/extensions/extension_warning_badge_service.h" |
| 28 #include "chrome/browser/extensions/extension_warning_set.h" | 28 #include "chrome/browser/extensions/extension_warning_set.h" |
| 29 #include "chrome/browser/extensions/lazy_background_task_queue.h" | 29 #include "chrome/browser/extensions/lazy_background_task_queue.h" |
| 30 #include "chrome/browser/extensions/management_policy.h" | 30 #include "chrome/browser/extensions/management_policy.h" |
| 31 #include "chrome/browser/extensions/navigation_observer.h" | 31 #include "chrome/browser/extensions/navigation_observer.h" |
| 32 #include "chrome/browser/extensions/shell_window_geometry_cache.h" | |
| 33 #include "chrome/browser/extensions/standard_management_policy_provider.h" | 32 #include "chrome/browser/extensions/standard_management_policy_provider.h" |
| 34 #include "chrome/browser/extensions/state_store.h" | 33 #include "chrome/browser/extensions/state_store.h" |
| 35 #include "chrome/browser/extensions/unpacked_installer.h" | 34 #include "chrome/browser/extensions/unpacked_installer.h" |
| 36 #include "chrome/browser/extensions/user_script_master.h" | 35 #include "chrome/browser/extensions/user_script_master.h" |
| 37 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
| 38 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
| 39 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 40 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/chrome_version_info.h" | 40 #include "chrome/common/chrome_version_info.h" |
| 42 #include "chrome/common/extensions/extension.h" | 41 #include "chrome/common/extensions/extension.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // requests. | 93 // requests. |
| 95 state_store_.reset(new StateStore( | 94 state_store_.reset(new StateStore( |
| 96 profile_, | 95 profile_, |
| 97 profile_->GetPath().AppendASCII(ExtensionService::kStateStoreName), | 96 profile_->GetPath().AppendASCII(ExtensionService::kStateStoreName), |
| 98 true)); | 97 true)); |
| 99 rules_store_.reset(new StateStore( | 98 rules_store_.reset(new StateStore( |
| 100 profile_, | 99 profile_, |
| 101 profile_->GetPath().AppendASCII(ExtensionService::kRulesStoreName), | 100 profile_->GetPath().AppendASCII(ExtensionService::kRulesStoreName), |
| 102 false)); | 101 false)); |
| 103 | 102 |
| 104 shell_window_geometry_cache_.reset(new ShellWindowGeometryCache( | |
| 105 profile_, ExtensionPrefs::Get(profile_))); | |
| 106 | |
| 107 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); | 103 blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); |
| 108 | 104 |
| 109 standard_management_policy_provider_.reset( | 105 standard_management_policy_provider_.reset( |
| 110 new StandardManagementPolicyProvider(ExtensionPrefs::Get(profile_))); | 106 new StandardManagementPolicyProvider(ExtensionPrefs::Get(profile_))); |
| 111 } | 107 } |
| 112 | 108 |
| 113 void ExtensionSystemImpl::Shared::RegisterManagementPolicyProviders() { | 109 void ExtensionSystemImpl::Shared::RegisterManagementPolicyProviders() { |
| 114 DCHECK(standard_management_policy_provider_.get()); | 110 DCHECK(standard_management_policy_provider_.get()); |
| 115 management_policy_->RegisterProvider( | 111 management_policy_->RegisterProvider( |
| 116 standard_management_policy_provider_.get()); | 112 standard_management_policy_provider_.get()); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 234 } |
| 239 | 235 |
| 240 StateStore* ExtensionSystemImpl::Shared::state_store() { | 236 StateStore* ExtensionSystemImpl::Shared::state_store() { |
| 241 return state_store_.get(); | 237 return state_store_.get(); |
| 242 } | 238 } |
| 243 | 239 |
| 244 StateStore* ExtensionSystemImpl::Shared::rules_store() { | 240 StateStore* ExtensionSystemImpl::Shared::rules_store() { |
| 245 return rules_store_.get(); | 241 return rules_store_.get(); |
| 246 } | 242 } |
| 247 | 243 |
| 248 ShellWindowGeometryCache* ExtensionSystemImpl::Shared:: | |
| 249 shell_window_geometry_cache() { | |
| 250 return shell_window_geometry_cache_.get(); | |
| 251 } | |
| 252 | |
| 253 ExtensionService* ExtensionSystemImpl::Shared::extension_service() { | 244 ExtensionService* ExtensionSystemImpl::Shared::extension_service() { |
| 254 return extension_service_.get(); | 245 return extension_service_.get(); |
| 255 } | 246 } |
| 256 | 247 |
| 257 ManagementPolicy* ExtensionSystemImpl::Shared::management_policy() { | 248 ManagementPolicy* ExtensionSystemImpl::Shared::management_policy() { |
| 258 return management_policy_.get(); | 249 return management_policy_.get(); |
| 259 } | 250 } |
| 260 | 251 |
| 261 UserScriptMaster* ExtensionSystemImpl::Shared::user_script_master() { | 252 UserScriptMaster* ExtensionSystemImpl::Shared::user_script_master() { |
| 262 return user_script_master_.get(); | 253 return user_script_master_.get(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 351 } |
| 361 | 352 |
| 362 StateStore* ExtensionSystemImpl::state_store() { | 353 StateStore* ExtensionSystemImpl::state_store() { |
| 363 return shared_->state_store(); | 354 return shared_->state_store(); |
| 364 } | 355 } |
| 365 | 356 |
| 366 StateStore* ExtensionSystemImpl::rules_store() { | 357 StateStore* ExtensionSystemImpl::rules_store() { |
| 367 return shared_->rules_store(); | 358 return shared_->rules_store(); |
| 368 } | 359 } |
| 369 | 360 |
| 370 ShellWindowGeometryCache* ExtensionSystemImpl::shell_window_geometry_cache() { | |
| 371 return shared_->shell_window_geometry_cache(); | |
| 372 } | |
| 373 | |
| 374 ExtensionInfoMap* ExtensionSystemImpl::info_map() { | 361 ExtensionInfoMap* ExtensionSystemImpl::info_map() { |
| 375 return shared_->info_map(); | 362 return shared_->info_map(); |
| 376 } | 363 } |
| 377 | 364 |
| 378 LazyBackgroundTaskQueue* ExtensionSystemImpl::lazy_background_task_queue() { | 365 LazyBackgroundTaskQueue* ExtensionSystemImpl::lazy_background_task_queue() { |
| 379 return shared_->lazy_background_task_queue(); | 366 return shared_->lazy_background_task_queue(); |
| 380 } | 367 } |
| 381 | 368 |
| 382 EventRouter* ExtensionSystemImpl::event_router() { | 369 EventRouter* ExtensionSystemImpl::event_router() { |
| 383 return shared_->event_router(); | 370 return shared_->event_router(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 415 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 429 const std::string& extension_id, | 416 const std::string& extension_id, |
| 430 const extension_misc::UnloadedExtensionReason reason) { | 417 const extension_misc::UnloadedExtensionReason reason) { |
| 431 BrowserThread::PostTask( | 418 BrowserThread::PostTask( |
| 432 BrowserThread::IO, FROM_HERE, | 419 BrowserThread::IO, FROM_HERE, |
| 433 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 420 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
| 434 extension_id, reason)); | 421 extension_id, reason)); |
| 435 } | 422 } |
| 436 | 423 |
| 437 } // namespace extensions | 424 } // namespace extensions |
| OLD | NEW |