Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: chrome/browser/ui/views/create_application_shortcut_view.cc

Issue 14322023: Don't request missing favicon on every page request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync up to r199996 Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 std::max(unprocessed_icons_.back().width, 469 std::max(unprocessed_icons_.back().width,
470 unprocessed_icons_.back().height), 470 unprocessed_icons_.back().height),
471 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon, 471 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon,
472 base::Unretained(this))); 472 base::Unretained(this)));
473 473
474 unprocessed_icons_.pop_back(); 474 unprocessed_icons_.pop_back();
475 } 475 }
476 476
477 void CreateUrlApplicationShortcutView::DidDownloadFavicon( 477 void CreateUrlApplicationShortcutView::DidDownloadFavicon(
478 int id, 478 int id,
479 int http_status_code,
479 const GURL& image_url, 480 const GURL& image_url,
480 int requested_size, 481 int requested_size,
481 const std::vector<SkBitmap>& bitmaps) { 482 const std::vector<SkBitmap>& bitmaps) {
482 if (id != pending_download_id_) 483 if (id != pending_download_id_)
483 return; 484 return;
484 pending_download_id_ = -1; 485 pending_download_id_ = -1;
485 486
486 SkBitmap image; 487 SkBitmap image;
487 488
488 if (!bitmaps.empty()) { 489 if (!bitmaps.empty()) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} 531 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {}
531 532
532 // Called when the app's ShortcutInfo (with icon) is loaded. 533 // Called when the app's ShortcutInfo (with icon) is loaded.
533 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( 534 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded(
534 const ShellIntegration::ShortcutInfo& shortcut_info) { 535 const ShellIntegration::ShortcutInfo& shortcut_info) {
535 shortcut_info_ = shortcut_info; 536 shortcut_info_ = shortcut_info;
536 537
537 CHECK(app_info_); 538 CHECK(app_info_);
538 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); 539 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
539 } 540 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/create_application_shortcut_view.h ('k') | chrome/browser/ui/web_applications/web_app_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698