| 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/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if (command_line->HasSwitch(switches::kDisableExtensions)) { | 94 if (command_line->HasSwitch(switches::kDisableExtensions)) { |
| 95 extensions_enabled_ = false; | 95 extensions_enabled_ = false; |
| 96 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) { | 96 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) { |
| 97 extensions_enabled_ = false; | 97 extensions_enabled_ = false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Set up the ExtensionUpdater | 100 // Set up the ExtensionUpdater |
| 101 if (autoupdate_enabled) { | 101 if (autoupdate_enabled) { |
| 102 int update_frequency = kDefaultUpdateFrequencySeconds; | 102 int update_frequency = kDefaultUpdateFrequencySeconds; |
| 103 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { | 103 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { |
| 104 update_frequency = StringToInt(WideToASCII(command_line->GetSwitchValue( | 104 update_frequency = StringToInt(command_line->GetSwitchValueASCII( |
| 105 switches::kExtensionsUpdateFrequency))); | 105 switches::kExtensionsUpdateFrequency)); |
| 106 } | 106 } |
| 107 updater_ = new ExtensionUpdater(this, prefs, update_frequency); | 107 updater_ = new ExtensionUpdater(this, prefs, update_frequency); |
| 108 } | 108 } |
| 109 | 109 |
| 110 backend_ = new ExtensionsServiceBackend(install_directory_); | 110 backend_ = new ExtensionsServiceBackend(install_directory_); |
| 111 } | 111 } |
| 112 | 112 |
| 113 ExtensionsService::~ExtensionsService() { | 113 ExtensionsService::~ExtensionsService() { |
| 114 UnloadAllExtensions(); | 114 UnloadAllExtensions(); |
| 115 if (updater_.get()) { | 115 if (updater_.get()) { |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 859 |
| 860 void ExtensionsServiceBackend::OnExternalExtensionFound( | 860 void ExtensionsServiceBackend::OnExternalExtensionFound( |
| 861 const std::string& id, const Version* version, const FilePath& path, | 861 const std::string& id, const Version* version, const FilePath& path, |
| 862 Extension::Location location) { | 862 Extension::Location location) { |
| 863 ChromeThread::PostTask( | 863 ChromeThread::PostTask( |
| 864 ChromeThread::UI, FROM_HERE, | 864 ChromeThread::UI, FROM_HERE, |
| 865 NewRunnableMethod( | 865 NewRunnableMethod( |
| 866 frontend_, &ExtensionsService::OnExternalExtensionFound, id, | 866 frontend_, &ExtensionsService::OnExternalExtensionFound, id, |
| 867 version->GetString(), path, location)); | 867 version->GetString(), path, location)); |
| 868 } | 868 } |
| OLD | NEW |