| 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/crypto/signature_verifier.h" | 9 #include "base/crypto/signature_verifier.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // The ID we expect this extension to have, if any. | 208 // The ID we expect this extension to have, if any. |
| 209 std::string expected_id_; | 209 std::string expected_id_; |
| 210 | 210 |
| 211 // True if we got a response from the utility process and have cleaned up | 211 // True if we got a response from the utility process and have cleaned up |
| 212 // already. | 212 // already. |
| 213 bool got_response_; | 213 bool got_response_; |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 ExtensionsService::ExtensionsService(Profile* profile, | 216 ExtensionsService::ExtensionsService(Profile* profile, |
| 217 const CommandLine* command_line, | 217 const CommandLine* command_line, |
| 218 PrefService* prefs, |
| 219 const FilePath& install_directory, |
| 218 MessageLoop* frontend_loop, | 220 MessageLoop* frontend_loop, |
| 219 MessageLoop* backend_loop) | 221 MessageLoop* backend_loop) |
| 220 : extension_prefs_(new ExtensionPrefs(profile->GetPrefs())), | 222 : extension_prefs_(new ExtensionPrefs(prefs, install_directory)), |
| 221 extension_process_manager_(new ExtensionProcessManager(profile)), | 223 extension_process_manager_(new ExtensionProcessManager(profile)), |
| 222 backend_loop_(backend_loop), | 224 backend_loop_(backend_loop), |
| 223 install_directory_(profile->GetPath().AppendASCII(kInstallDirectoryName)), | 225 install_directory_(install_directory), |
| 224 extensions_enabled_(false), | 226 extensions_enabled_(false), |
| 225 show_extensions_prompts_(true), | 227 show_extensions_prompts_(true), |
| 226 ready_(false) { | 228 ready_(false) { |
| 227 // Figure out if extension installation should be enabled. | 229 // Figure out if extension installation should be enabled. |
| 228 if (command_line->HasSwitch(switches::kEnableExtensions)) | 230 if (command_line->HasSwitch(switches::kEnableExtensions)) |
| 229 extensions_enabled_ = true; | 231 extensions_enabled_ = true; |
| 230 else if (profile->GetPrefs()->GetBoolean(prefs::kEnableExtensions)) | 232 else if (profile->GetPrefs()->GetBoolean(prefs::kEnableExtensions)) |
| 231 extensions_enabled_ = true; | 233 extensions_enabled_ = true; |
| 232 | 234 |
| 233 backend_ = new ExtensionsServiceBackend( | 235 backend_ = new ExtensionsServiceBackend( |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 Extension::InstallType install_type = | 1375 Extension::InstallType install_type = |
| 1374 CompareToInstalledVersion(id, version->GetString(), ¤t_version); | 1376 CompareToInstalledVersion(id, version->GetString(), ¤t_version); |
| 1375 | 1377 |
| 1376 if (install_type == Extension::DOWNGRADE) | 1378 if (install_type == Extension::DOWNGRADE) |
| 1377 return false; | 1379 return false; |
| 1378 | 1380 |
| 1379 return (install_type == Extension::UPGRADE || | 1381 return (install_type == Extension::UPGRADE || |
| 1380 install_type == Extension::NEW_INSTALL || | 1382 install_type == Extension::NEW_INSTALL || |
| 1381 NeedsReinstall(id, current_version)); | 1383 NeedsReinstall(id, current_version)); |
| 1382 } | 1384 } |
| OLD | NEW |