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/ui/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 return true; | 482 return true; |
483 } | 483 } |
484 | 484 |
485 void CreateUrlApplicationShortcutView::FetchIcon() { | 485 void CreateUrlApplicationShortcutView::FetchIcon() { |
486 // There should only be fetch job at a time. | 486 // There should only be fetch job at a time. |
487 DCHECK_EQ(-1, pending_download_id_); | 487 DCHECK_EQ(-1, pending_download_id_); |
488 | 488 |
489 if (unprocessed_icons_.empty()) // No icons to fetch. | 489 if (unprocessed_icons_.empty()) // No icons to fetch. |
490 return; | 490 return; |
491 | 491 |
492 pending_download_id_ = web_contents_->DownloadFavicon( | 492 pending_download_id_ = web_contents_->DownloadImage( |
493 unprocessed_icons_.back().url, | 493 unprocessed_icons_.back().url, |
494 true, | 494 true, |
495 std::max(unprocessed_icons_.back().width, | 495 std::max(unprocessed_icons_.back().width, |
496 unprocessed_icons_.back().height), | 496 unprocessed_icons_.back().height), |
497 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon, | 497 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon, |
498 base::Unretained(this))); | 498 base::Unretained(this))); |
499 | 499 |
500 unprocessed_icons_.pop_back(); | 500 unprocessed_icons_.pop_back(); |
501 } | 501 } |
502 | 502 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} | 553 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} |
554 | 554 |
555 // Called when the app's ShortcutInfo (with icon) is loaded. | 555 // Called when the app's ShortcutInfo (with icon) is loaded. |
556 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( | 556 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( |
557 const ShellIntegration::ShortcutInfo& shortcut_info) { | 557 const ShellIntegration::ShortcutInfo& shortcut_info) { |
558 shortcut_info_ = shortcut_info; | 558 shortcut_info_ = shortcut_info; |
559 | 559 |
560 CHECK(app_info_); | 560 CHECK(app_info_); |
561 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 561 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
562 } | 562 } |
OLD | NEW |