| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 ExtensionsService::ExtensionsService(Profile* profile, | 84 ExtensionsService::ExtensionsService(Profile* profile, |
| 85 const CommandLine* command_line, | 85 const CommandLine* command_line, |
| 86 PrefService* prefs, | 86 PrefService* prefs, |
| 87 const FilePath& install_directory, | 87 const FilePath& install_directory, |
| 88 bool autoupdate_enabled) | 88 bool autoupdate_enabled) |
| 89 : profile_(profile), | 89 : profile_(profile), |
| 90 extension_prefs_(new ExtensionPrefs(prefs, install_directory)), | 90 extension_prefs_(new ExtensionPrefs(prefs, install_directory)), |
| 91 install_directory_(install_directory), | 91 install_directory_(install_directory), |
| 92 extensions_enabled_(true), | 92 extensions_enabled_(true), |
| 93 show_extensions_prompts_(true), | 93 show_extensions_prompts_(true), |
| 94 ready_(false) { | 94 ready_(false), |
| 95 ALLOW_THIS_IN_INITIALIZER_LIST(toolbar_model_(this)) { |
| 95 // Figure out if extension installation should be enabled. | 96 // Figure out if extension installation should be enabled. |
| 96 if (command_line->HasSwitch(switches::kDisableExtensions)) { | 97 if (command_line->HasSwitch(switches::kDisableExtensions)) { |
| 97 extensions_enabled_ = false; | 98 extensions_enabled_ = false; |
| 98 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) { | 99 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) { |
| 99 extensions_enabled_ = false; | 100 extensions_enabled_ = false; |
| 100 } | 101 } |
| 101 | 102 |
| 102 registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING, | 103 registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING, |
| 103 NotificationService::AllSources()); | 104 NotificationService::AllSources()); |
| 104 registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED, | 105 registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED, |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 984 |
| 984 void ExtensionsServiceBackend::OnExternalExtensionFound( | 985 void ExtensionsServiceBackend::OnExternalExtensionFound( |
| 985 const std::string& id, const Version* version, const FilePath& path, | 986 const std::string& id, const Version* version, const FilePath& path, |
| 986 Extension::Location location) { | 987 Extension::Location location) { |
| 987 ChromeThread::PostTask( | 988 ChromeThread::PostTask( |
| 988 ChromeThread::UI, FROM_HERE, | 989 ChromeThread::UI, FROM_HERE, |
| 989 NewRunnableMethod( | 990 NewRunnableMethod( |
| 990 frontend_, &ExtensionsService::OnExternalExtensionFound, id, | 991 frontend_, &ExtensionsService::OnExternalExtensionFound, id, |
| 991 version->GetString(), path, location)); | 992 version->GetString(), path, location)); |
| 992 } | 993 } |
| OLD | NEW |