Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / installer / util / work_item.cc
blob01d2b1935fe853017e5d79f2eb5f88bc5528e016
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
3 // found in the LICENSE file.
5 #include "chrome/installer/util/work_item.h"
7 #include <windows.h>
9 #include "chrome/installer/util/callback_work_item.h"
10 #include "chrome/installer/util/conditional_work_item_list.h"
11 #include "chrome/installer/util/copy_tree_work_item.h"
12 #include "chrome/installer/util/create_dir_work_item.h"
13 #include "chrome/installer/util/create_reg_key_work_item.h"
14 #include "chrome/installer/util/delete_tree_work_item.h"
15 #include "chrome/installer/util/delete_reg_key_work_item.h"
16 #include "chrome/installer/util/delete_reg_value_work_item.h"
17 #include "chrome/installer/util/move_tree_work_item.h"
18 #include "chrome/installer/util/self_reg_work_item.h"
19 #include "chrome/installer/util/set_reg_value_work_item.h"
20 #include "chrome/installer/util/work_item_list.h"
22 WorkItem::WorkItem() : ignore_failure_(false) {
25 WorkItem::~WorkItem() {
28 CallbackWorkItem* WorkItem::CreateCallbackWorkItem(
29 base::Callback<bool(const CallbackWorkItem&)> callback) {
30 return new CallbackWorkItem(callback);
33 CopyTreeWorkItem* WorkItem::CreateCopyTreeWorkItem(
34 const base::FilePath& source_path,
35 const base::FilePath& dest_path,
36 const base::FilePath& temp_dir,
37 CopyOverWriteOption overwrite_option,
38 const base::FilePath& alternative_path) {
39 return new CopyTreeWorkItem(source_path, dest_path, temp_dir,
40 overwrite_option, alternative_path);
43 CreateDirWorkItem* WorkItem::CreateCreateDirWorkItem(
44 const base::FilePath& path) {
45 return new CreateDirWorkItem(path);
48 CreateRegKeyWorkItem* WorkItem::CreateCreateRegKeyWorkItem(
49 HKEY predefined_root,
50 const std::wstring& path,
51 REGSAM wow64_access) {
52 return new CreateRegKeyWorkItem(predefined_root, path, wow64_access);
55 DeleteRegKeyWorkItem* WorkItem::CreateDeleteRegKeyWorkItem(
56 HKEY predefined_root,
57 const std::wstring& path,
58 REGSAM wow64_access) {
59 return new DeleteRegKeyWorkItem(predefined_root, path, wow64_access);
62 DeleteRegValueWorkItem* WorkItem::CreateDeleteRegValueWorkItem(
63 HKEY predefined_root,
64 const std::wstring& key_path,
65 REGSAM wow64_access,
66 const std::wstring& value_name) {
67 return new DeleteRegValueWorkItem(
68 predefined_root, key_path, wow64_access, value_name);
71 DeleteTreeWorkItem* WorkItem::CreateDeleteTreeWorkItem(
72 const base::FilePath& root_path,
73 const base::FilePath& temp_path,
74 const std::vector<base::FilePath>& key_paths) {
75 return new DeleteTreeWorkItem(root_path, temp_path, key_paths);
78 MoveTreeWorkItem* WorkItem::CreateMoveTreeWorkItem(
79 const base::FilePath& source_path,
80 const base::FilePath& dest_path,
81 const base::FilePath& temp_dir,
82 MoveTreeOption duplicate_option) {
83 return new MoveTreeWorkItem(source_path,
84 dest_path,
85 temp_dir,
86 duplicate_option);
89 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem(
90 HKEY predefined_root,
91 const std::wstring& key_path,
92 REGSAM wow64_access,
93 const std::wstring& value_name,
94 const std::wstring& value_data,
95 bool overwrite) {
96 return new SetRegValueWorkItem(predefined_root,
97 key_path,
98 wow64_access,
99 value_name,
100 value_data,
101 overwrite);
104 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem(
105 HKEY predefined_root,
106 const std::wstring& key_path,
107 REGSAM wow64_access,
108 const std::wstring& value_name,
109 DWORD value_data,
110 bool overwrite) {
111 return new SetRegValueWorkItem(predefined_root,
112 key_path,
113 wow64_access,
114 value_name,
115 value_data,
116 overwrite);
119 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem(
120 HKEY predefined_root,
121 const std::wstring& key_path,
122 REGSAM wow64_access,
123 const std::wstring& value_name,
124 int64 value_data,
125 bool overwrite) {
126 return new SetRegValueWorkItem(predefined_root,
127 key_path,
128 wow64_access,
129 value_name,
130 value_data,
131 overwrite);
134 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem(
135 HKEY predefined_root,
136 const std::wstring& key_path,
137 REGSAM wow64_access,
138 const std::wstring& value_name,
139 const GetValueFromExistingCallback& get_value_callback) {
140 return new SetRegValueWorkItem(predefined_root,
141 key_path,
142 wow64_access,
143 value_name,
144 get_value_callback);
147 SelfRegWorkItem* WorkItem::CreateSelfRegWorkItem(const std::wstring& dll_path,
148 bool do_register,
149 bool user_level_registration) {
150 return new SelfRegWorkItem(dll_path, do_register, user_level_registration);
153 WorkItemList* WorkItem::CreateWorkItemList() {
154 return new WorkItemList();
157 // static
158 WorkItemList* WorkItem::CreateNoRollbackWorkItemList() {
159 return new NoRollbackWorkItemList();
162 WorkItemList* WorkItem::CreateConditionalWorkItemList(Condition* condition) {
163 return new ConditionalWorkItemList(condition);