OLD | NEW |
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 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 scoped_ptr<Version> max_version(new Version("0.0.0.0")); | 132 scoped_ptr<Version> max_version(new Version("0.0.0.0")); |
133 bool version_found = false; | 133 bool version_found = false; |
134 | 134 |
135 while (!version_enum.Next().empty()) { | 135 while (!version_enum.Next().empty()) { |
136 file_util::FileEnumerator::FindInfo find_data = {0}; | 136 file_util::FileEnumerator::FindInfo find_data = {0}; |
137 version_enum.GetFindInfo(&find_data); | 137 version_enum.GetFindInfo(&find_data); |
138 VLOG(1) << "directory found: " << find_data.cFileName; | 138 VLOG(1) << "directory found: " << find_data.cFileName; |
139 | 139 |
140 scoped_ptr<Version> found_version( | 140 scoped_ptr<Version> found_version( |
141 new Version(WideToASCII(find_data.cFileName))); | 141 new Version(base::WideToASCII(find_data.cFileName))); |
142 if (found_version->IsValid() && | 142 if (found_version->IsValid() && |
143 found_version->CompareTo(*max_version.get()) > 0) { | 143 found_version->CompareTo(*max_version.get()) > 0) { |
144 max_version.reset(found_version.release()); | 144 max_version.reset(found_version.release()); |
145 version_found = true; | 145 version_found = true; |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 return (version_found ? max_version.release() : NULL); | 149 return (version_found ? max_version.release() : NULL); |
150 } | 150 } |
151 | 151 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 345 } |
346 | 346 |
347 ScopedTokenPrivilege::~ScopedTokenPrivilege() { | 347 ScopedTokenPrivilege::~ScopedTokenPrivilege() { |
348 if (is_enabled_ && previous_privileges_.PrivilegeCount != 0) { | 348 if (is_enabled_ && previous_privileges_.PrivilegeCount != 0) { |
349 ::AdjustTokenPrivileges(token_, FALSE, &previous_privileges_, | 349 ::AdjustTokenPrivileges(token_, FALSE, &previous_privileges_, |
350 sizeof(TOKEN_PRIVILEGES), NULL, NULL); | 350 sizeof(TOKEN_PRIVILEGES), NULL, NULL); |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 } // namespace installer | 354 } // namespace installer |
OLD | NEW |