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

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

Issue 14973007: Auto-install/uninstall shared module dependencies for extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 7 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 return; 405 return;
406 406
407 if (SharedModuleInfo::ImportsModules(extension())) { 407 if (SharedModuleInfo::ImportsModules(extension())) {
408 const std::vector<SharedModuleInfo::ImportInfo>& imports = 408 const std::vector<SharedModuleInfo::ImportInfo>& imports =
409 SharedModuleInfo::GetImports(extension()); 409 SharedModuleInfo::GetImports(extension());
410 std::vector<SharedModuleInfo::ImportInfo>::const_iterator i; 410 std::vector<SharedModuleInfo::ImportInfo>::const_iterator i;
411 for (i = imports.begin(); i != imports.end(); ++i) { 411 for (i = imports.begin(); i != imports.end(); ++i) {
412 Version version_required(i->minimum_version); 412 Version version_required(i->minimum_version);
413 const Extension* imported_module = 413 const Extension* imported_module =
414 service->GetExtensionById(i->extension_id, true); 414 service->GetExtensionById(i->extension_id, true);
415 if (!imported_module || 415 if (imported_module &&
416 (version_required.IsValid() && 416 !SharedModuleInfo::IsSharedModule(imported_module)) {
417 imported_module->version()->CompareTo(version_required) < 0)) {
418 ReportFailureFromUIThread(
419 CrxInstallerError(l10n_util::GetStringFUTF16(
420 IDS_EXTENSION_INSTALL_DEPENDENCY_NOT_FOUND,
421 ASCIIToUTF16(i->extension_id),
422 ASCIIToUTF16(i->minimum_version))));
423 return;
424 }
425 if (!SharedModuleInfo::IsSharedModule(imported_module)) {
426 ReportFailureFromUIThread( 417 ReportFailureFromUIThread(
427 CrxInstallerError(l10n_util::GetStringFUTF16( 418 CrxInstallerError(l10n_util::GetStringFUTF16(
428 IDS_EXTENSION_INSTALL_DEPENDENCY_NOT_SHARED_MODULE, 419 IDS_EXTENSION_INSTALL_DEPENDENCY_NOT_SHARED_MODULE,
429 ASCIIToUTF16(i->extension_id)))); 420 ASCIIToUTF16(i->extension_id))));
430 return; 421 return;
431 } 422 }
432 } 423 }
433 } 424 }
434 installer_.CheckRequirements(base::Bind(&CrxInstaller::OnRequirementsChecked, 425 installer_.CheckRequirements(base::Bind(&CrxInstaller::OnRequirementsChecked,
435 this)); 426 this));
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) 781 if (!prefs->DidExtensionEscalatePermissions(extension()->id()))
791 return; 782 return;
792 783
793 if (client_) { 784 if (client_) {
794 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 785 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
795 client_->ConfirmReEnable(this, extension()); 786 client_->ConfirmReEnable(this, extension());
796 } 787 }
797 } 788 }
798 789
799 } // namespace extensions 790 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698