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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 // Set window's icon to the one we're about to create/update in the web app | 368 // Set window's icon to the one we're about to create/update in the web app |
369 // path. The icon cache will refresh on icon creation. | 369 // path. The icon cache will refresh on icon creation. |
370 base::FilePath web_app_path = web_app::GetWebAppDataDirectory( | 370 base::FilePath web_app_path = web_app::GetWebAppDataDirectory( |
371 shortcut_info->profile_path, shortcut_info->extension_id, | 371 shortcut_info->profile_path, shortcut_info->extension_id, |
372 shortcut_info->url); | 372 shortcut_info->url); |
373 base::FilePath icon_file = | 373 base::FilePath icon_file = |
374 web_app::internals::GetIconFilePath(web_app_path, shortcut_info->title); | 374 web_app::internals::GetIconFilePath(web_app_path, shortcut_info->title); |
375 const web_app::ShortcutInfo& shortcut_info_ref = *shortcut_info; | 375 const web_app::ShortcutInfo& shortcut_info_ref = *shortcut_info; |
376 base::PostTaskWithTraitsAndReply( | 376 base::PostTaskWithTraitsAndReply( |
377 FROM_HERE, | 377 FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, |
378 base::TaskTraits().MayBlock().WithPriority( | |
379 base::TaskPriority::USER_VISIBLE), | |
380 base::Bind(&CreateIconAndSetRelaunchDetails, web_app_path, icon_file, | 378 base::Bind(&CreateIconAndSetRelaunchDetails, web_app_path, icon_file, |
381 base::ConstRef(shortcut_info_ref), hwnd), | 379 base::ConstRef(shortcut_info_ref), hwnd), |
382 base::Bind(&web_app::internals::DeleteShortcutInfoOnUIThread, | 380 base::Bind(&web_app::internals::DeleteShortcutInfoOnUIThread, |
383 base::Passed(&shortcut_info), base::Closure())); | 381 base::Passed(&shortcut_info), base::Closure())); |
384 } | 382 } |
385 | 383 |
386 } // namespace | 384 } // namespace |
387 | 385 |
388 namespace web_app { | 386 namespace web_app { |
389 | 387 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 609 |
612 } // namespace internals | 610 } // namespace internals |
613 | 611 |
614 void UpdateShortcutForTabContents(content::WebContents* web_contents) { | 612 void UpdateShortcutForTabContents(content::WebContents* web_contents) { |
615 // UpdateShortcutWorker will delete itself when it's done. | 613 // UpdateShortcutWorker will delete itself when it's done. |
616 UpdateShortcutWorker* worker = new UpdateShortcutWorker(web_contents); | 614 UpdateShortcutWorker* worker = new UpdateShortcutWorker(web_contents); |
617 worker->Run(); | 615 worker->Run(); |
618 } | 616 } |
619 | 617 |
620 } // namespace web_app | 618 } // namespace web_app |
OLD | NEW |