| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 << "installed"; | 347 << "installed"; |
| 348 FireInstallCallback(extension_path, NULL); | 348 FireInstallCallback(extension_path, NULL); |
| 349 return; | 349 return; |
| 350 } | 350 } |
| 351 | 351 |
| 352 backend_loop_->PostTask(FROM_HERE, NewRunnableMethod(backend_.get(), | 352 backend_loop_->PostTask(FROM_HERE, NewRunnableMethod(backend_.get(), |
| 353 &ExtensionsServiceBackend::UpdateExtension, id, extension_path, | 353 &ExtensionsServiceBackend::UpdateExtension, id, extension_path, |
| 354 alert_on_error, scoped_refptr<ExtensionsService>(this))); | 354 alert_on_error, scoped_refptr<ExtensionsService>(this))); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void ExtensionsService::ReloadExtension(const std::string& extension_id) { | |
| 358 Extension* extension = GetExtensionById(extension_id); | |
| 359 FilePath extension_path = extension->path(); | |
| 360 | |
| 361 UnloadExtension(extension_id); | |
| 362 LoadExtension(extension_path); | |
| 363 } | |
| 364 | |
| 365 void ExtensionsService::UninstallExtension(const std::string& extension_id, | 357 void ExtensionsService::UninstallExtension(const std::string& extension_id, |
| 366 bool external_uninstall) { | 358 bool external_uninstall) { |
| 367 Extension* extension = GetExtensionById(extension_id); | 359 Extension* extension = GetExtensionById(extension_id); |
| 368 | 360 |
| 369 // Callers should not send us nonexistant extensions. | 361 // Callers should not send us nonexistant extensions. |
| 370 DCHECK(extension); | 362 DCHECK(extension); |
| 371 | 363 |
| 372 extension_prefs_->OnExtensionUninstalled(extension, external_uninstall); | 364 extension_prefs_->OnExtensionUninstalled(extension, external_uninstall); |
| 373 | 365 |
| 374 // Tell the backend to start deleting installed extensions on the file thread. | 366 // Tell the backend to start deleting installed extensions on the file thread. |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 Extension::InstallType install_type = | 1502 Extension::InstallType install_type = |
| 1511 CompareToInstalledVersion(id, version->GetString(), ¤t_version); | 1503 CompareToInstalledVersion(id, version->GetString(), ¤t_version); |
| 1512 | 1504 |
| 1513 if (install_type == Extension::DOWNGRADE) | 1505 if (install_type == Extension::DOWNGRADE) |
| 1514 return false; | 1506 return false; |
| 1515 | 1507 |
| 1516 return (install_type == Extension::UPGRADE || | 1508 return (install_type == Extension::UPGRADE || |
| 1517 install_type == Extension::NEW_INSTALL || | 1509 install_type == Extension::NEW_INSTALL || |
| 1518 NeedsReinstall(id, current_version)); | 1510 NeedsReinstall(id, current_version)); |
| 1519 } | 1511 } |
| OLD | NEW |