| 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 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 467 |
| 468 if (unprocessed_icons_.empty()) // No icons to fetch. | 468 if (unprocessed_icons_.empty()) // No icons to fetch. |
| 469 return; | 469 return; |
| 470 | 470 |
| 471 int preferred_size = std::max(unprocessed_icons_.back().width, | 471 int preferred_size = std::max(unprocessed_icons_.back().width, |
| 472 unprocessed_icons_.back().height); | 472 unprocessed_icons_.back().height); |
| 473 pending_download_id_ = web_contents_->DownloadImage( | 473 pending_download_id_ = web_contents_->DownloadImage( |
| 474 unprocessed_icons_.back().url, | 474 unprocessed_icons_.back().url, |
| 475 true, // is a favicon | 475 true, // is a favicon |
| 476 0, // no maximum size | 476 0, // no maximum size |
| 477 false, // normal cache policy |
| 477 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon, | 478 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon, |
| 478 weak_ptr_factory_.GetWeakPtr(), | 479 weak_ptr_factory_.GetWeakPtr(), |
| 479 preferred_size)); | 480 preferred_size)); |
| 480 | 481 |
| 481 unprocessed_icons_.pop_back(); | 482 unprocessed_icons_.pop_back(); |
| 482 } | 483 } |
| 483 | 484 |
| 484 void CreateUrlApplicationShortcutView::DidDownloadFavicon( | 485 void CreateUrlApplicationShortcutView::DidDownloadFavicon( |
| 485 int requested_size, | 486 int requested_size, |
| 486 int id, | 487 int id, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 close_callback_.Run(false); | 540 close_callback_.Run(false); |
| 540 return CreateApplicationShortcutView::Cancel(); | 541 return CreateApplicationShortcutView::Cancel(); |
| 541 } | 542 } |
| 542 | 543 |
| 543 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( | 544 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( |
| 544 const web_app::ShortcutInfo& shortcut_info, | 545 const web_app::ShortcutInfo& shortcut_info, |
| 545 const extensions::FileHandlersInfo& file_handlers_info) { | 546 const extensions::FileHandlersInfo& file_handlers_info) { |
| 546 shortcut_info_ = shortcut_info; | 547 shortcut_info_ = shortcut_info; |
| 547 file_handlers_info_ = file_handlers_info; | 548 file_handlers_info_ = file_handlers_info; |
| 548 } | 549 } |
| OLD | NEW |