OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SET_REG_VALUE_WORK_ITEM_H__ | 5 #ifndef CHROME_INSTALLER_UTIL_SET_REG_VALUE_WORK_ITEM_H__ |
6 #define CHROME_INSTALLER_UTIL_SET_REG_VALUE_WORK_ITEM_H__ | 6 #define CHROME_INSTALLER_UTIL_SET_REG_VALUE_WORK_ITEM_H__ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "chrome/installer/util/work_item.h" | 13 #include "chrome/installer/util/work_item.h" |
14 | 14 |
15 // A WorkItem subclass that sets a registry value with REG_SZ, REG_DWORD, or | 15 // A WorkItem subclass that sets a registry value with REG_SZ, REG_DWORD, or |
16 // REG_QWORD type at the specified path. The value is only set if the target key | 16 // REG_QWORD type at the specified path. The value is only set if the target key |
17 // exists. | 17 // exists. |
18 class SetRegValueWorkItem : public WorkItem { | 18 class SetRegValueWorkItem : public WorkItem { |
19 public: | 19 public: |
20 virtual ~SetRegValueWorkItem(); | 20 ~SetRegValueWorkItem() override; |
21 | 21 |
22 virtual bool Do(); | 22 bool Do() override; |
23 | 23 |
24 virtual void Rollback(); | 24 void Rollback() override; |
25 | 25 |
26 private: | 26 private: |
27 friend class WorkItem; | 27 friend class WorkItem; |
28 | 28 |
29 enum SettingStatus { | 29 enum SettingStatus { |
30 // The status before Do is called. | 30 // The status before Do is called. |
31 SET_VALUE, | 31 SET_VALUE, |
32 // One possible outcome after Do(). A new value is created under the key. | 32 // One possible outcome after Do(). A new value is created under the key. |
33 NEW_VALUE_CREATED, | 33 NEW_VALUE_CREATED, |
34 // One possible outcome after Do(). The previous value under the key has | 34 // One possible outcome after Do(). The previous value under the key has |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Type of data to store | 82 // Type of data to store |
83 DWORD type_; | 83 DWORD type_; |
84 std::vector<uint8> value_; | 84 std::vector<uint8> value_; |
85 DWORD previous_type_; | 85 DWORD previous_type_; |
86 std::vector<uint8> previous_value_; | 86 std::vector<uint8> previous_value_; |
87 | 87 |
88 SettingStatus status_; | 88 SettingStatus status_; |
89 }; | 89 }; |
90 | 90 |
91 #endif // CHROME_INSTALLER_UTIL_SET_REG_VALUE_WORK_ITEM_H__ | 91 #endif // CHROME_INSTALLER_UTIL_SET_REG_VALUE_WORK_ITEM_H__ |
OLD | NEW |