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

Unified Diff: components/component_updater/default_component_installer.cc

Issue 2085583005: Allow DCI to pick up contents from Internet Plug-Ins on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarified comments. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/component_updater/default_component_installer.cc
diff --git a/components/component_updater/default_component_installer.cc b/components/component_updater/default_component_installer.cc
index 43fd8722e5fbe698a39268eb0d4d7f83501d9cdd..111a45f5796e3d6a99661da7f677f834acf4aeb9 100644
--- a/components/component_updater/default_component_installer.cc
+++ b/components/component_updater/default_component_installer.cc
@@ -152,14 +152,9 @@ bool DefaultComponentInstaller::Uninstall() {
return true;
}
-bool DefaultComponentInstaller::FindPreinstallation() {
- base::FilePath path;
- if (!PathService::Get(DIR_COMPONENT_PREINSTALLED, &path)) {
- DVLOG(1) << "DIR_COMPONENT_PREINSTALLED does not exist.";
- return false;
- }
-
- path = path.Append(installer_traits_->GetRelativeInstallDir());
+bool DefaultComponentInstaller::FindPreinstallation(
+ const base::FilePath& root) {
+ base::FilePath path = root.Append(installer_traits_->GetRelativeInstallDir());
if (!base::PathExists(path)) {
DVLOG(1) << "Relative install dir does not exist: " << path.MaybeAsASCII();
return false;
@@ -207,8 +202,19 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) {
base::Version latest_version(kNullVersion);
// First check for an installation set up alongside Chrome itself.
- if (FindPreinstallation())
+ base::FilePath root;
+ if (PathService::Get(DIR_COMPONENT_PREINSTALLED, &root) &&
+ FindPreinstallation(root)) {
latest_version = current_version_;
+ }
+
+ // If there is a distinct alternate root, check there as well, and override
+ // anything found in the basic root.
+ base::FilePath root_alternate;
+ if (PathService::Get(DIR_COMPONENT_PREINSTALLED_ALT, &root_alternate) &&
+ root != root_alternate && FindPreinstallation(root_alternate)) {
+ latest_version = current_version_;
+ }
// Then check for a higher-versioned user-wide installation.
base::FilePath latest_path;

Powered by Google App Engine
This is Rietveld 408576698