| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (command_line->HasSwitch(switches::kDisableExtensions)) { | 96 if (command_line->HasSwitch(switches::kDisableExtensions)) { |
| 97 extensions_enabled_ = false; | 97 extensions_enabled_ = false; |
| 98 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) { | 98 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) { |
| 99 extensions_enabled_ = false; | 99 extensions_enabled_ = false; |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Set up the ExtensionUpdater | 102 // Set up the ExtensionUpdater |
| 103 if (autoupdate_enabled) { | 103 if (autoupdate_enabled) { |
| 104 int update_frequency = kDefaultUpdateFrequencySeconds; | 104 int update_frequency = kDefaultUpdateFrequencySeconds; |
| 105 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { | 105 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { |
| 106 update_frequency = StringToInt(WideToASCII(command_line->GetSwitchValue( | 106 update_frequency = StringToInt(command_line->GetSwitchValueASCII( |
| 107 switches::kExtensionsUpdateFrequency))); | 107 switches::kExtensionsUpdateFrequency)); |
| 108 } | 108 } |
| 109 updater_ = new ExtensionUpdater(this, prefs, update_frequency); | 109 updater_ = new ExtensionUpdater(this, prefs, update_frequency); |
| 110 } | 110 } |
| 111 | 111 |
| 112 backend_ = new ExtensionsServiceBackend(install_directory_); | 112 backend_ = new ExtensionsServiceBackend(install_directory_); |
| 113 } | 113 } |
| 114 | 114 |
| 115 ExtensionsService::~ExtensionsService() { | 115 ExtensionsService::~ExtensionsService() { |
| 116 UnloadAllExtensions(); | 116 UnloadAllExtensions(); |
| 117 if (updater_.get()) { | 117 if (updater_.get()) { |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 | 904 |
| 905 void ExtensionsServiceBackend::OnExternalExtensionFound( | 905 void ExtensionsServiceBackend::OnExternalExtensionFound( |
| 906 const std::string& id, const Version* version, const FilePath& path, | 906 const std::string& id, const Version* version, const FilePath& path, |
| 907 Extension::Location location) { | 907 Extension::Location location) { |
| 908 ChromeThread::PostTask( | 908 ChromeThread::PostTask( |
| 909 ChromeThread::UI, FROM_HERE, | 909 ChromeThread::UI, FROM_HERE, |
| 910 NewRunnableMethod( | 910 NewRunnableMethod( |
| 911 frontend_, &ExtensionsService::OnExternalExtensionFound, id, | 911 frontend_, &ExtensionsService::OnExternalExtensionFound, id, |
| 912 version->GetString(), path, location)); | 912 version->GetString(), path, location)); |
| 913 } | 913 } |
| OLD | NEW |