OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 DeleteMe(); // We are done if underlying TabContents is gone. | 546 DeleteMe(); // We are done if underlying TabContents is gone. |
547 return; | 547 return; |
548 } | 548 } |
549 | 549 |
550 if (unprocessed_icons_.empty()) { | 550 if (unprocessed_icons_.empty()) { |
551 // No app icon. Just use the favicon from TabContents. | 551 // No app icon. Just use the favicon from TabContents. |
552 UpdateShortcuts(); | 552 UpdateShortcuts(); |
553 return; | 553 return; |
554 } | 554 } |
555 | 555 |
556 tab_contents_->fav_icon_helper().DownloadImage( | 556 tab_contents_->favicon_helper().DownloadImage( |
557 unprocessed_icons_.back().url, | 557 unprocessed_icons_.back().url, |
558 std::max(unprocessed_icons_.back().width, | 558 std::max(unprocessed_icons_.back().width, |
559 unprocessed_icons_.back().height), | 559 unprocessed_icons_.back().height), |
560 NewCallback(this, &UpdateShortcutWorker::OnIconDownloaded)); | 560 NewCallback(this, &UpdateShortcutWorker::OnIconDownloaded)); |
561 unprocessed_icons_.pop_back(); | 561 unprocessed_icons_.pop_back(); |
562 } | 562 } |
563 | 563 |
564 void UpdateShortcutWorker::OnIconDownloaded(int download_id, | 564 void UpdateShortcutWorker::OnIconDownloaded(int download_id, |
565 bool errored, | 565 bool errored, |
566 const SkBitmap& image) { | 566 const SkBitmap& image) { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 794 |
795 void UpdateShortcutForTabContents(TabContents* tab_contents) { | 795 void UpdateShortcutForTabContents(TabContents* tab_contents) { |
796 #if defined(OS_WIN) | 796 #if defined(OS_WIN) |
797 // UpdateShortcutWorker will delete itself when it's done. | 797 // UpdateShortcutWorker will delete itself when it's done. |
798 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); | 798 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); |
799 worker->Run(); | 799 worker->Run(); |
800 #endif // defined(OS_WIN) | 800 #endif // defined(OS_WIN) |
801 } | 801 } |
802 | 802 |
803 }; // namespace web_app | 803 }; // namespace web_app |
OLD | NEW |