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 "chrome/browser/web_applications/web_app_win.h" | 5 #include "chrome/browser/web_applications/web_app_win.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // Check whether there is an existing shortcut to this app. | 220 // Check whether there is an existing shortcut to this app. |
221 std::vector<base::FilePath> shortcut_files = | 221 std::vector<base::FilePath> shortcut_files = |
222 FindAppShortcutsByProfileAndTitle(shortcut_paths[i], | 222 FindAppShortcutsByProfileAndTitle(shortcut_paths[i], |
223 shortcut_info.profile_path, | 223 shortcut_info.profile_path, |
224 shortcut_info.title); | 224 shortcut_info.title); |
225 if (!shortcut_files.empty()) | 225 if (!shortcut_files.empty()) |
226 continue; | 226 continue; |
227 } | 227 } |
228 if (shortcut_paths[i] != web_app_path) { | 228 if (shortcut_paths[i] != web_app_path) { |
229 int unique_number = | 229 int unique_number = |
230 file_util::GetUniquePathNumber(shortcut_file, FILE_PATH_LITERAL("")); | 230 base::GetUniquePathNumber(shortcut_file, |
| 231 base::FilePath::StringType()); |
231 if (unique_number == -1) { | 232 if (unique_number == -1) { |
232 success = false; | 233 success = false; |
233 continue; | 234 continue; |
234 } else if (unique_number > 0) { | 235 } else if (unique_number > 0) { |
235 shortcut_file = shortcut_file.InsertBeforeExtensionASCII( | 236 shortcut_file = shortcut_file.InsertBeforeExtensionASCII( |
236 base::StringPrintf(" (%d)", unique_number)); | 237 base::StringPrintf(" (%d)", unique_number)); |
237 } | 238 } |
238 } | 239 } |
239 base::win::ShortcutProperties shortcut_properties; | 240 base::win::ShortcutProperties shortcut_properties; |
240 shortcut_properties.set_target(chrome_exe); | 241 shortcut_properties.set_target(chrome_exe); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } | 532 } |
532 shortcut_paths.push_back(path); | 533 shortcut_paths.push_back(path); |
533 } | 534 } |
534 } | 535 } |
535 return shortcut_paths; | 536 return shortcut_paths; |
536 } | 537 } |
537 | 538 |
538 } // namespace internals | 539 } // namespace internals |
539 | 540 |
540 } // namespace web_app | 541 } // namespace web_app |
OLD | NEW |