| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 229 } |
| 230 | 230 |
| 231 extension_warning_service_.reset(new ExtensionWarningService(profile_)); | 231 extension_warning_service_.reset(new ExtensionWarningService(profile_)); |
| 232 extension_warning_badge_service_.reset( | 232 extension_warning_badge_service_.reset( |
| 233 new ExtensionWarningBadgeService(profile_)); | 233 new ExtensionWarningBadgeService(profile_)); |
| 234 extension_warning_service_->AddObserver( | 234 extension_warning_service_->AddObserver( |
| 235 extension_warning_badge_service_.get()); | 235 extension_warning_badge_service_.get()); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void ExtensionSystemImpl::Shared::Shutdown() { | 238 void ExtensionSystemImpl::Shared::Shutdown() { |
| 239 if (extension_warning_service_.get()) { | 239 if (extension_warning_service_) { |
| 240 extension_warning_service_->RemoveObserver( | 240 extension_warning_service_->RemoveObserver( |
| 241 extension_warning_badge_service_.get()); | 241 extension_warning_badge_service_.get()); |
| 242 } | 242 } |
| 243 if (extension_service_.get()) | 243 if (extension_service_) |
| 244 extension_service_->Shutdown(); | 244 extension_service_->Shutdown(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 base::Clock* ExtensionSystemImpl::Shared::clock() { | 247 base::Clock* ExtensionSystemImpl::Shared::clock() { |
| 248 return &clock_; | 248 return &clock_; |
| 249 } | 249 } |
| 250 | 250 |
| 251 StateStore* ExtensionSystemImpl::Shared::state_store() { | 251 StateStore* ExtensionSystemImpl::Shared::state_store() { |
| 252 return state_store_.get(); | 252 return state_store_.get(); |
| 253 } | 253 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 shared_ = ExtensionSystemSharedFactory::GetForProfile(profile); | 313 shared_ = ExtensionSystemSharedFactory::GetForProfile(profile); |
| 314 | 314 |
| 315 if (profile->IsOffTheRecord()) { | 315 if (profile->IsOffTheRecord()) { |
| 316 extension_process_manager_.reset(ExtensionProcessManager::Create(profile)); | 316 extension_process_manager_.reset(ExtensionProcessManager::Create(profile)); |
| 317 } else { | 317 } else { |
| 318 shared_->InitPrefs(); | 318 shared_->InitPrefs(); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 ExtensionSystemImpl::~ExtensionSystemImpl() { | 322 ExtensionSystemImpl::~ExtensionSystemImpl() { |
| 323 if (rules_registry_service_.get()) | 323 if (rules_registry_service_) |
| 324 rules_registry_service_->Shutdown(); | 324 rules_registry_service_->Shutdown(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 void ExtensionSystemImpl::Shutdown() { | 327 void ExtensionSystemImpl::Shutdown() { |
| 328 extension_process_manager_.reset(); | 328 extension_process_manager_.reset(); |
| 329 | 329 |
| 330 if (profile_->IsOffTheRecord() && extension_service() && | 330 if (profile_->IsOffTheRecord() && extension_service() && |
| 331 extension_service()->extensions_enabled()) | 331 extension_service()->extensions_enabled()) |
| 332 extension_prefs()->ClearIncognitoSessionOnlyContentSettings(); | 332 extension_prefs()->ClearIncognitoSessionOnlyContentSettings(); |
| 333 } | 333 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 464 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 465 const std::string& extension_id, | 465 const std::string& extension_id, |
| 466 const extension_misc::UnloadedExtensionReason reason) { | 466 const extension_misc::UnloadedExtensionReason reason) { |
| 467 BrowserThread::PostTask( | 467 BrowserThread::PostTask( |
| 468 BrowserThread::IO, FROM_HERE, | 468 BrowserThread::IO, FROM_HERE, |
| 469 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 469 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
| 470 extension_id, reason)); | 470 extension_id, reason)); |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace extensions | 473 } // namespace extensions |
| OLD | NEW |