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

Side by Side Diff: chrome/installer/setup/setup_util.cc

Issue 2618583005: Remove support for non-browser products from InstallationState and ProductState. (Closed)
Patch Set: sync to position 442664 Created 3 years, 11 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 | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/setup/setup_util_unittest.cc » ('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 // This file declares util functions for setup project. 5 // This file declares util functions for setup project.
6 6
7 #include "chrome/installer/setup/setup_util.h" 7 #include "chrome/installer/setup/setup_util.h"
8 8
9 #include <windows.h> 9 #include <windows.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (desired_version.IsValid()) { 358 if (desired_version.IsValid()) {
359 base::FilePath archive(installer_state.GetInstallerDirectory( 359 base::FilePath archive(installer_state.GetInstallerDirectory(
360 desired_version).Append(kChromeArchive)); 360 desired_version).Append(kChromeArchive));
361 return base::PathExists(archive) ? archive : base::FilePath(); 361 return base::PathExists(archive) ? archive : base::FilePath();
362 } 362 }
363 363
364 // Check based on the version number advertised to Google Update, since that 364 // Check based on the version number advertised to Google Update, since that
365 // is the value used to select a specific differential update. If an archive 365 // is the value used to select a specific differential update. If an archive
366 // can't be found using that, fallback to using the newest version present. 366 // can't be found using that, fallback to using the newest version present.
367 base::FilePath patch_source; 367 base::FilePath patch_source;
368 const ProductState* product = original_state.GetProductState( 368 const ProductState* product =
369 installer_state.system_install(), BrowserDistribution::CHROME_BROWSER); 369 original_state.GetProductState(installer_state.system_install());
370 if (product) { 370 if (product) {
371 patch_source = installer_state.GetInstallerDirectory(product->version()) 371 patch_source = installer_state.GetInstallerDirectory(product->version())
372 .Append(installer::kChromeArchive); 372 .Append(installer::kChromeArchive);
373 if (base::PathExists(patch_source)) 373 if (base::PathExists(patch_source))
374 return patch_source; 374 return patch_source;
375 } 375 }
376 std::unique_ptr<base::Version> version( 376 std::unique_ptr<base::Version> version(
377 installer::GetMaxVersionFromArchiveDir(installer_state.target_path())); 377 installer::GetMaxVersionFromArchiveDir(installer_state.target_path()));
378 if (version) { 378 if (version) {
379 patch_source = installer_state.GetInstallerDirectory(*version) 379 patch_source = installer_state.GetInstallerDirectory(*version)
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 } 852 }
853 853
854 ScopedTokenPrivilege::~ScopedTokenPrivilege() { 854 ScopedTokenPrivilege::~ScopedTokenPrivilege() {
855 if (is_enabled_ && previous_privileges_.PrivilegeCount != 0) { 855 if (is_enabled_ && previous_privileges_.PrivilegeCount != 0) {
856 ::AdjustTokenPrivileges(token_.Get(), FALSE, &previous_privileges_, 856 ::AdjustTokenPrivileges(token_.Get(), FALSE, &previous_privileges_,
857 sizeof(TOKEN_PRIVILEGES), NULL, NULL); 857 sizeof(TOKEN_PRIVILEGES), NULL, NULL);
858 } 858 }
859 } 859 }
860 860
861 } // namespace installer 861 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/setup/setup_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698