OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windows.h> | 5 #include <windows.h> |
6 #include <shlobj.h> | 6 #include <shlobj.h> |
7 | 7 |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 break; | 159 break; |
160 case base::DIR_USER_QUICK_LAUNCH: | 160 case base::DIR_USER_QUICK_LAUNCH: |
161 if (!PathService::Get(base::DIR_APP_DATA, &cur)) | 161 if (!PathService::Get(base::DIR_APP_DATA, &cur)) |
162 return false; | 162 return false; |
163 // According to various sources, appending | 163 // According to various sources, appending |
164 // "Microsoft\Internet Explorer\Quick Launch" to %appdata% is the only | 164 // "Microsoft\Internet Explorer\Quick Launch" to %appdata% is the only |
165 // reliable way to get the quick launch folder across all versions of | 165 // reliable way to get the quick launch folder across all versions of |
166 // Windows. | 166 // Windows. |
167 // http://stackoverflow.com/questions/76080/how-do-you-reliably-get-the-qu ick- | 167 // http://stackoverflow.com/questions/76080/how-do-you-reliably-get-the-qu ick- |
168 // http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/he y0901.mspx | 168 // http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/he y0901.mspx |
169 cur = cur.AppendASCII("Microsoft") | 169 cur = cur.Append(FILE_PATH_LITERAL("Microsoft")) |
170 .AppendASCII("Internet Explorer") | 170 .Append(FILE_PATH_LITERAL("Internet Explorer")) |
Mark Mentovai
2016/06/20 22:17:26
I would have thought that clang-format would line
Patrick Monette
2016/06/20 22:35:39
I've rechecked and I confirm that this is what cla
| |
171 .AppendASCII("Quick Launch"); | 171 .Append(FILE_PATH_LITERAL("Quick Launch")); |
172 break; | 172 break; |
173 case base::DIR_TASKBAR_PINS: | 173 case base::DIR_TASKBAR_PINS: |
174 if (!PathService::Get(base::DIR_USER_QUICK_LAUNCH, &cur)) | 174 if (!PathService::Get(base::DIR_USER_QUICK_LAUNCH, &cur)) |
175 return false; | 175 return false; |
176 cur = cur.AppendASCII("User Pinned"); | 176 cur = cur.Append(FILE_PATH_LITERAL("User Pinned")); |
177 cur = cur.AppendASCII("TaskBar"); | 177 cur = cur.Append(FILE_PATH_LITERAL("TaskBar")); |
178 break; | 178 break; |
179 case base::DIR_WINDOWS_FONTS: | 179 case base::DIR_WINDOWS_FONTS: |
180 if (FAILED(SHGetFolderPath( | 180 if (FAILED(SHGetFolderPath( |
181 NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, system_buffer))) { | 181 NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, system_buffer))) { |
182 return false; | 182 return false; |
183 } | 183 } |
184 cur = FilePath(system_buffer); | 184 cur = FilePath(system_buffer); |
185 break; | 185 break; |
186 default: | 186 default: |
187 return false; | 187 return false; |
188 } | 188 } |
189 | 189 |
190 *result = cur; | 190 *result = cur; |
191 return true; | 191 return true; |
192 } | 192 } |
193 | 193 |
194 } // namespace base | 194 } // namespace base |
OLD | NEW |