| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 364 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 365 | 365 |
| 366 // Set window's icon to the one we're about to create/update in the web app | 366 // Set window's icon to the one we're about to create/update in the web app |
| 367 // path. The icon cache will refresh on icon creation. | 367 // path. The icon cache will refresh on icon creation. |
| 368 base::FilePath web_app_path = web_app::GetWebAppDataDirectory( | 368 base::FilePath web_app_path = web_app::GetWebAppDataDirectory( |
| 369 shortcut_info->profile_path, shortcut_info->extension_id, | 369 shortcut_info->profile_path, shortcut_info->extension_id, |
| 370 shortcut_info->url); | 370 shortcut_info->url); |
| 371 base::FilePath icon_file = | 371 base::FilePath icon_file = |
| 372 web_app::internals::GetIconFilePath(web_app_path, shortcut_info->title); | 372 web_app::internals::GetIconFilePath(web_app_path, shortcut_info->title); |
| 373 | 373 |
| 374 // |shortcut_info->favicon| is not shared outside of this function, and needs |
| 375 // to be used on another thread. |
| 376 shortcut_info->favicon.DetachFromThread(); |
| 374 web_app::ShortcutInfo::PostIOTask( | 377 web_app::ShortcutInfo::PostIOTask( |
| 375 base::BindOnce(&CreateIconAndSetRelaunchDetails, web_app_path, icon_file, | 378 base::BindOnce(&CreateIconAndSetRelaunchDetails, web_app_path, icon_file, |
| 376 hwnd), | 379 hwnd), |
| 377 std::move(shortcut_info)); | 380 std::move(shortcut_info)); |
| 378 } | 381 } |
| 379 | 382 |
| 380 } // namespace | 383 } // namespace |
| 381 | 384 |
| 382 namespace web_app { | 385 namespace web_app { |
| 383 | 386 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 609 |
| 607 } // namespace internals | 610 } // namespace internals |
| 608 | 611 |
| 609 void UpdateShortcutForTabContents(content::WebContents* web_contents) { | 612 void UpdateShortcutForTabContents(content::WebContents* web_contents) { |
| 610 // UpdateShortcutWorker will delete itself when it's done. | 613 // UpdateShortcutWorker will delete itself when it's done. |
| 611 UpdateShortcutWorker* worker = new UpdateShortcutWorker(web_contents); | 614 UpdateShortcutWorker* worker = new UpdateShortcutWorker(web_contents); |
| 612 worker->Run(); | 615 worker->Run(); |
| 613 } | 616 } |
| 614 | 617 |
| 615 } // namespace web_app | 618 } // namespace web_app |
| OLD | NEW |