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.h" | 5 #include "chrome/browser/web_applications/web_app.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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 string16 wide_switches(cmd_line.GetCommandLineString()); | 199 string16 wide_switches(cmd_line.GetCommandLineString()); |
200 | 200 |
201 // Sanitize description | 201 // Sanitize description |
202 string16 description = shortcut_info.description; | 202 string16 description = shortcut_info.description; |
203 if (description.length() >= MAX_PATH) | 203 if (description.length() >= MAX_PATH) |
204 description.resize(MAX_PATH - 1); | 204 description.resize(MAX_PATH - 1); |
205 | 205 |
206 // Generates app id from web app url and profile path. | 206 // Generates app id from web app url and profile path. |
207 std::string app_name = | 207 std::string app_name = |
208 web_app::GenerateApplicationNameFromInfo(shortcut_info); | 208 web_app::GenerateApplicationNameFromInfo(shortcut_info); |
209 string16 app_id = ShellIntegration::GetAppId( | 209 string16 app_id = ShellIntegration::GetAppModelIdForProfile( |
210 UTF8ToUTF16(app_name), profile_path); | 210 UTF8ToUTF16(app_name), profile_path); |
211 | 211 |
212 FilePath shortcut_to_pin; | 212 FilePath shortcut_to_pin; |
213 | 213 |
214 bool success = true; | 214 bool success = true; |
215 for (size_t i = 0; i < shortcut_paths.size(); ++i) { | 215 for (size_t i = 0; i < shortcut_paths.size(); ++i) { |
216 FilePath shortcut_file = shortcut_paths[i].Append(file_name). | 216 FilePath shortcut_file = shortcut_paths[i].Append(file_name). |
217 ReplaceExtension(FILE_PATH_LITERAL(".lnk")); | 217 ReplaceExtension(FILE_PATH_LITERAL(".lnk")); |
218 | 218 |
219 int unique_number = | 219 int unique_number = |
(...skipping 30 matching lines...) Expand all Loading... |
250 success = false; | 250 success = false; |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
254 return success; | 254 return success; |
255 } | 255 } |
256 | 256 |
257 } // namespace internals | 257 } // namespace internals |
258 | 258 |
259 } // namespace web_app | 259 } // namespace web_app |
OLD | NEW |