| 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/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; |
| 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // TODO: refactor this because it is only used once. | 18 // TODO: refactor this because it is only used once. |
| 17 void UpOneDirectoryOrEmpty(std::wstring* dir) { | 19 void UpOneDirectoryOrEmpty(std::wstring* dir) { |
| 18 FilePath path = FilePath::FromWStringHack(*dir); | 20 FilePath path = FilePath::FromWStringHack(*dir); |
| 19 FilePath directory = path.DirName(); | 21 FilePath directory = path.DirName(); |
| 20 // If there is no separator, we will get back kCurrentDirectory. | 22 // If there is no separator, we will get back kCurrentDirectory. |
| 21 // In this case, clear dir. | 23 // In this case, clear dir. |
| 22 if (directory == path || directory.value() == FilePath::kCurrentDirectory) | 24 if (directory == path || directory.value() == FilePath::kCurrentDirectory) |
| 23 dir->clear(); | 25 dir->clear(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 115 |
| 114 do { | 116 do { |
| 115 key_list_.push_back(key_path); | 117 key_list_.push_back(key_path); |
| 116 // 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 |
| 117 // path is file path or registry path. | 119 // path is file path or registry path. |
| 118 UpOneDirectoryOrEmpty(&key_path); | 120 UpOneDirectoryOrEmpty(&key_path); |
| 119 } while (!key_path.empty()); | 121 } while (!key_path.empty()); |
| 120 | 122 |
| 121 return true; | 123 return true; |
| 122 } | 124 } |
| OLD | NEW |