OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <shlwapi.h> | 5 #include <shlwapi.h> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/win/registry.h" | 9 #include "base/win/registry.h" |
10 #include "chrome/installer/util/create_reg_key_work_item.h" | 10 #include "chrome/installer/util/create_reg_key_work_item.h" |
11 #include "chrome/installer/util/install_util.h" | 11 #include "chrome/installer/util/install_util.h" |
12 #include "chrome/installer/util/logging_installer.h" | 12 #include "chrome/installer/util/logging_installer.h" |
13 | 13 |
14 using base::win::RegKey; | 14 using base::win::RegKey; |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // TODO: refactor this because it is only used once. | 18 // TODO: refactor this because it is only used once. |
19 void UpOneDirectoryOrEmpty(std::wstring* dir) { | 19 void UpOneDirectoryOrEmpty(std::wstring* dir) { |
20 FilePath path = FilePath::FromWStringHack(*dir); | 20 base::FilePath path = base::FilePath::FromWStringHack(*dir); |
21 FilePath directory = path.DirName(); | 21 base::FilePath directory = path.DirName(); |
22 // If there is no separator, we will get back kCurrentDirectory. | 22 // If there is no separator, we will get back kCurrentDirectory. |
23 // In this case, clear dir. | 23 // In this case, clear dir. |
24 if (directory == path || directory.value() == FilePath::kCurrentDirectory) | 24 if (directory == path || directory.value() == |
| 25 base::FilePath::kCurrentDirectory) |
25 dir->clear(); | 26 dir->clear(); |
26 else | 27 else |
27 *dir = directory.value(); | 28 *dir = directory.value(); |
28 } | 29 } |
29 | 30 |
30 } // namespace | 31 } // namespace |
31 | 32 |
32 CreateRegKeyWorkItem::~CreateRegKeyWorkItem() { | 33 CreateRegKeyWorkItem::~CreateRegKeyWorkItem() { |
33 } | 34 } |
34 | 35 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 115 |
115 do { | 116 do { |
116 key_list_.push_back(key_path); | 117 key_list_.push_back(key_path); |
117 // This is pure string operation so it does not matter whether the | 118 // This is pure string operation so it does not matter whether the |
118 // path is file path or registry path. | 119 // path is file path or registry path. |
119 UpOneDirectoryOrEmpty(&key_path); | 120 UpOneDirectoryOrEmpty(&key_path); |
120 } while (!key_path.empty()); | 121 } while (!key_path.empty()); |
121 | 122 |
122 return true; | 123 return true; |
123 } | 124 } |
OLD | NEW |