Chromium Code Reviews| 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 #ifndef CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
| 6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 CHROME_FRAME_DLL = 1 << 0, | 219 CHROME_FRAME_DLL = 1 << 0, |
| 220 CHROME_FRAME_HELPER_EXE = 1 << 1, | 220 CHROME_FRAME_HELPER_EXE = 1 << 1, |
| 221 CHROME_DLL = 1 << 2, | 221 CHROME_DLL = 1 << 2, |
| 222 NUM_BINARIES = 3 | 222 NUM_BINARIES = 3 |
| 223 }; | 223 }; |
| 224 | 224 |
| 225 // Returns true if |file| exists and cannot be opened for exclusive write | 225 // Returns true if |file| exists and cannot be opened for exclusive write |
| 226 // access. | 226 // access. |
| 227 static bool IsFileInUse(const base::FilePath& file); | 227 static bool IsFileInUse(const base::FilePath& file); |
| 228 | 228 |
| 229 // Clears the instance to an uninitialized state. | |
| 230 void Clear(); | |
|
robertshield
2013/11/29 18:50:25
Can we add a unit test for Clear()?
grt (UTC plus 2)
2013/12/02 15:28:31
I've added one for re-initializing an instance.
| |
| 231 | |
| 229 // Returns true if any file corresponding to a bit in |file_bits| (from the | 232 // Returns true if any file corresponding to a bit in |file_bits| (from the |
| 230 // enum above) for the currently installed version exists and is in use. | 233 // enum above) for the currently installed version exists and is in use. |
| 231 bool AnyExistsAndIsInUse(const InstallationState& machine_state, | 234 bool AnyExistsAndIsInUse(const InstallationState& machine_state, |
| 232 uint32 file_bits) const; | 235 uint32 file_bits) const; |
| 233 base::FilePath GetDefaultProductInstallPath(BrowserDistribution* dist) const; | 236 base::FilePath GetDefaultProductInstallPath(BrowserDistribution* dist) const; |
| 234 bool CanAddProduct(const Product& product, | 237 bool CanAddProduct(const Product& product, |
| 235 const base::FilePath* product_dir) const; | 238 const base::FilePath* product_dir) const; |
| 236 Product* AddProductInDirectory(const base::FilePath* product_dir, | 239 Product* AddProductInDirectory(const base::FilePath* product_dir, |
| 237 scoped_ptr<Product>* product); | 240 scoped_ptr<Product>* product); |
| 238 Product* AddProductFromPreferences( | 241 Product* AddProductFromPreferences( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 bool verbose_logging_; | 273 bool verbose_logging_; |
| 271 bool ensure_google_update_present_; | 274 bool ensure_google_update_present_; |
| 272 | 275 |
| 273 private: | 276 private: |
| 274 DISALLOW_COPY_AND_ASSIGN(InstallerState); | 277 DISALLOW_COPY_AND_ASSIGN(InstallerState); |
| 275 }; // class InstallerState | 278 }; // class InstallerState |
| 276 | 279 |
| 277 } // namespace installer | 280 } // namespace installer |
| 278 | 281 |
| 279 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 282 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
| OLD | NEW |