OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SETUP_UPDATE_ACTIVE_SETUP_VERSION_WORK_ITEM_H_ | 5 #ifndef CHROME_INSTALLER_SETUP_UPDATE_ACTIVE_SETUP_VERSION_WORK_ITEM_H_ |
6 #define CHROME_INSTALLER_SETUP_UPDATE_ACTIVE_SETUP_VERSION_WORK_ITEM_H_ | 6 #define CHROME_INSTALLER_SETUP_UPDATE_ACTIVE_SETUP_VERSION_WORK_ITEM_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "chrome/installer/util/set_reg_value_work_item.h" | 10 #include "chrome/installer/util/set_reg_value_work_item.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // (will default to 1 if the version was absent or invalid). | 36 // (will default to 1 if the version was absent or invalid). |
37 UPDATE_AND_BUMP_OS_UPGRADES_COMPONENT, | 37 UPDATE_AND_BUMP_OS_UPGRADES_COMPONENT, |
38 }; | 38 }; |
39 | 39 |
40 // Constructs an UpdateActiveSetupVersionWorkItem that will perform | 40 // Constructs an UpdateActiveSetupVersionWorkItem that will perform |
41 // |operation| on the |active_setup_path| key in the registry. This key needs | 41 // |operation| on the |active_setup_path| key in the registry. This key needs |
42 // to exist when this WorkItem is ran. | 42 // to exist when this WorkItem is ran. |
43 UpdateActiveSetupVersionWorkItem(const base::string16& active_setup_path, | 43 UpdateActiveSetupVersionWorkItem(const base::string16& active_setup_path, |
44 Operation operation); | 44 Operation operation); |
45 | 45 |
| 46 // Overriden from WorkItem. |
| 47 bool Do() override; |
| 48 void Rollback() override; |
| 49 |
46 private: | 50 private: |
47 // WorkItem: | |
48 bool DoImpl() override; | |
49 void RollbackImpl() override; | |
50 | |
51 // Returns the updated Active Setup version to be used based on the | 51 // Returns the updated Active Setup version to be used based on the |
52 // |existing_version|. | 52 // |existing_version|. |
53 base::string16 GetUpdatedActiveSetupVersion( | 53 base::string16 GetUpdatedActiveSetupVersion( |
54 const base::string16& existing_version); | 54 const base::string16& existing_version); |
55 | 55 |
56 // The underlying WorkItem re-used to operate forward and backward on the | 56 // The underlying WorkItem re-used to operate forward and backward on the |
57 // registry. | 57 // registry. |
58 SetRegValueWorkItem set_reg_value_work_item_; | 58 SetRegValueWorkItem set_reg_value_work_item_; |
59 | 59 |
60 // The Operation to be performed by this WorkItem when executed. | 60 // The Operation to be performed by this WorkItem when executed. |
61 const Operation operation_; | 61 const Operation operation_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(UpdateActiveSetupVersionWorkItem); | 63 DISALLOW_COPY_AND_ASSIGN(UpdateActiveSetupVersionWorkItem); |
64 }; | 64 }; |
65 | 65 |
66 #endif // CHROME_INSTALLER_SETUP_UPDATE_ACTIVE_SETUP_VERSION_WORK_ITEM_H_ | 66 #endif // CHROME_INSTALLER_SETUP_UPDATE_ACTIVE_SETUP_VERSION_WORK_ITEM_H_ |
OLD | NEW |