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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // | 57 // |
58 // ExtensionSystemImpl::Shared | 58 // ExtensionSystemImpl::Shared |
59 // | 59 // |
60 | 60 |
61 ExtensionSystemImpl::Shared::Shared(Profile* profile) | 61 ExtensionSystemImpl::Shared::Shared(Profile* profile) |
62 : profile_(profile) { | 62 : profile_(profile) { |
63 } | 63 } |
64 | 64 |
65 ExtensionSystemImpl::Shared::~Shared() { | 65 ExtensionSystemImpl::Shared::~Shared() { |
66 rules_registry_service_->Shutdown(); | 66 if (rules_registry_service_.get()) |
| 67 rules_registry_service_->Shutdown(); |
67 } | 68 } |
68 | 69 |
69 void ExtensionSystemImpl::Shared::InitPrefs() { | 70 void ExtensionSystemImpl::Shared::InitPrefs() { |
70 bool extensions_disabled = | 71 bool extensions_disabled = |
71 profile_->GetPrefs()->GetBoolean(prefs::kDisableExtensions) || | 72 profile_->GetPrefs()->GetBoolean(prefs::kDisableExtensions) || |
72 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); | 73 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); |
73 extension_prefs_.reset(new ExtensionPrefs( | 74 extension_prefs_.reset(new ExtensionPrefs( |
74 profile_->GetPrefs(), | 75 profile_->GetPrefs(), |
75 profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 76 profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
76 ExtensionPrefValueMapFactory::GetForProfile(profile_))); | 77 ExtensionPrefValueMapFactory::GetForProfile(profile_))); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 312 } |
312 | 313 |
313 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 314 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
314 const std::string& extension_id, | 315 const std::string& extension_id, |
315 const extension_misc::UnloadedExtensionReason reason) { | 316 const extension_misc::UnloadedExtensionReason reason) { |
316 BrowserThread::PostTask( | 317 BrowserThread::PostTask( |
317 BrowserThread::IO, FROM_HERE, | 318 BrowserThread::IO, FROM_HERE, |
318 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 319 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
319 extension_id, reason)); | 320 extension_id, reason)); |
320 } | 321 } |
OLD | NEW |