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/ui/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "chrome/browser/extensions/extension_tab_helper.h" | 10 #include "chrome/browser/extensions/extension_tab_helper.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 if (unprocessed_icons_.empty()) // No icons to fetch. | 450 if (unprocessed_icons_.empty()) // No icons to fetch. |
451 return; | 451 return; |
452 | 452 |
453 pending_download_ = new IconDownloadCallbackFunctor(this); | 453 pending_download_ = new IconDownloadCallbackFunctor(this); |
454 DCHECK(pending_download_); | 454 DCHECK(pending_download_); |
455 | 455 |
456 tab_contents_->tab_contents()->favicon_helper().DownloadImage( | 456 tab_contents_->tab_contents()->favicon_helper().DownloadImage( |
457 unprocessed_icons_.back().url, | 457 unprocessed_icons_.back().url, |
458 std::max(unprocessed_icons_.back().width, | 458 std::max(unprocessed_icons_.back().width, |
459 unprocessed_icons_.back().height), | 459 unprocessed_icons_.back().height), |
| 460 history::FAVICON, |
460 NewCallback(pending_download_, &IconDownloadCallbackFunctor::Run)); | 461 NewCallback(pending_download_, &IconDownloadCallbackFunctor::Run)); |
461 | 462 |
462 unprocessed_icons_.pop_back(); | 463 unprocessed_icons_.pop_back(); |
463 } | 464 } |
464 | 465 |
465 void CreateUrlApplicationShortcutView::OnIconDownloaded(bool errored, | 466 void CreateUrlApplicationShortcutView::OnIconDownloaded(bool errored, |
466 const SkBitmap& image) { | 467 const SkBitmap& image) { |
467 pending_download_ = NULL; | 468 pending_download_ = NULL; |
468 | 469 |
469 if (!errored && !image.isNull()) { | 470 if (!errored && !image.isNull()) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 void CreateChromeApplicationShortcutView::OnImageLoaded( | 520 void CreateChromeApplicationShortcutView::OnImageLoaded( |
520 SkBitmap* image, const ExtensionResource& resource, int index) { | 521 SkBitmap* image, const ExtensionResource& resource, int index) { |
521 if (image->isNull()) { | 522 if (image->isNull()) { |
522 NOTREACHED() << "Corrupt image in profile?"; | 523 NOTREACHED() << "Corrupt image in profile?"; |
523 return; | 524 return; |
524 } | 525 } |
525 shortcut_info_.favicon = *image; | 526 shortcut_info_.favicon = *image; |
526 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 527 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
527 } | 528 } |
528 | 529 |
OLD | NEW |