Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: chrome/browser/extensions/extensions_service.cc

Issue 159323: Make possible restarting extensions from the chrome://extensions/ page.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
357 void ExtensionsService::UninstallExtension(const std::string& extension_id, 365 void ExtensionsService::UninstallExtension(const std::string& extension_id,
358 bool external_uninstall) { 366 bool external_uninstall) {
359 Extension* extension = GetExtensionById(extension_id); 367 Extension* extension = GetExtensionById(extension_id);
360 368
361 // Callers should not send us nonexistant extensions. 369 // Callers should not send us nonexistant extensions.
362 DCHECK(extension); 370 DCHECK(extension);
363 371
364 extension_prefs_->OnExtensionUninstalled(extension, external_uninstall); 372 extension_prefs_->OnExtensionUninstalled(extension, external_uninstall);
365 373
366 // Tell the backend to start deleting installed extensions on the file thread. 374 // Tell the backend to start deleting installed extensions on the file thread.
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 Extension::InstallType install_type = 1510 Extension::InstallType install_type =
1503 CompareToInstalledVersion(id, version->GetString(), &current_version); 1511 CompareToInstalledVersion(id, version->GetString(), &current_version);
1504 1512
1505 if (install_type == Extension::DOWNGRADE) 1513 if (install_type == Extension::DOWNGRADE)
1506 return false; 1514 return false;
1507 1515
1508 return (install_type == Extension::UPGRADE || 1516 return (install_type == Extension::UPGRADE ||
1509 install_type == Extension::NEW_INSTALL || 1517 install_type == Extension::NEW_INSTALL ||
1510 NeedsReinstall(id, current_version)); 1518 NeedsReinstall(id, current_version));
1511 } 1519 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/extensions/extensions_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698