OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/install_static/product_install_details.h" | 5 #include "chrome/install_static/product_install_details.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "chrome/install_static/install_details.h" | 11 #include "chrome/install_static/install_details.h" |
12 #include "chrome/install_static/install_modes.h" | 12 #include "chrome/install_static/install_modes.h" |
13 #include "chrome/install_static/install_util.h" | 13 #include "chrome/install_static/install_util.h" |
| 14 #include "chrome/install_static/user_data_dir.h" |
14 #include "chrome_elf/nt_registry/nt_registry.h" | 15 #include "chrome_elf/nt_registry/nt_registry.h" |
15 | 16 |
16 namespace install_static { | 17 namespace install_static { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 // Returns the executable path for the current process. | 21 // Returns the executable path for the current process. |
21 std::wstring GetCurrentProcessExePath() { | 22 std::wstring GetCurrentProcessExePath() { |
22 std::wstring exe_path(MAX_PATH, L'\0'); | 23 std::wstring exe_path(MAX_PATH, L'\0'); |
23 DWORD length = ::GetModuleFileName(nullptr, &exe_path[0], exe_path.size()); | 24 DWORD length = ::GetModuleFileName(nullptr, &exe_path[0], exe_path.size()); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Cache the ap and cohort name values found in the registry for use in crash | 133 // Cache the ap and cohort name values found in the registry for use in crash |
133 // keys and in about:version. | 134 // keys and in about:version. |
134 std::wstring update_ap; | 135 std::wstring update_ap; |
135 std::wstring update_cohort_name; | 136 std::wstring update_cohort_name; |
136 details->set_channel(DetermineChannel(*mode, system_level, | 137 details->set_channel(DetermineChannel(*mode, system_level, |
137 false /* !from_binaries */, &update_ap, | 138 false /* !from_binaries */, &update_ap, |
138 &update_cohort_name)); | 139 &update_cohort_name)); |
139 details->set_update_ap(update_ap); | 140 details->set_update_ap(update_ap); |
140 details->set_update_cohort_name(update_cohort_name); | 141 details->set_update_cohort_name(update_cohort_name); |
141 | 142 |
| 143 if (CurrentProcessNeedsProfileDir()) { |
| 144 std::wstring user_data_dir; |
| 145 std::wstring invalid_user_data_dir; |
| 146 install_static::DeriveUserDataDirectory(*mode, &user_data_dir, |
| 147 &invalid_user_data_dir); |
| 148 details->set_user_data_dir(user_data_dir); |
| 149 details->set_invalid_user_data_dir(invalid_user_data_dir); |
| 150 } |
| 151 |
142 return details; | 152 return details; |
143 } | 153 } |
144 | 154 |
145 } // namespace install_static | 155 } // namespace install_static |
OLD | NEW |