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

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

Issue 12945007: Fix Notifications Icon loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tiny fix Created 7 years, 9 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 void CreateUrlApplicationShortcutView::FetchIcon() { 486 void CreateUrlApplicationShortcutView::FetchIcon() {
487 // There should only be fetch job at a time. 487 // There should only be fetch job at a time.
488 DCHECK_EQ(-1, pending_download_id_); 488 DCHECK_EQ(-1, pending_download_id_);
489 489
490 if (unprocessed_icons_.empty()) // No icons to fetch. 490 if (unprocessed_icons_.empty()) // No icons to fetch.
491 return; 491 return;
492 492
493 pending_download_id_ = web_contents_->DownloadFavicon( 493 pending_download_id_ = web_contents_->DownloadFavicon(
494 unprocessed_icons_.back().url, 494 unprocessed_icons_.back().url,
495 true, // favicon
jam 2013/03/20 02:44:42 ditto
495 std::max(unprocessed_icons_.back().width, 496 std::max(unprocessed_icons_.back().width,
496 unprocessed_icons_.back().height), 497 unprocessed_icons_.back().height),
497 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon, 498 base::Bind(&CreateUrlApplicationShortcutView::DidDownloadFavicon,
498 base::Unretained(this))); 499 base::Unretained(this)));
499 500
500 unprocessed_icons_.pop_back(); 501 unprocessed_icons_.pop_back();
501 } 502 }
502 503
503 void CreateUrlApplicationShortcutView::DidDownloadFavicon( 504 void CreateUrlApplicationShortcutView::DidDownloadFavicon(
504 int id, 505 int id,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {} 554 CreateChromeApplicationShortcutView::~CreateChromeApplicationShortcutView() {}
554 555
555 // Called when the app's ShortcutInfo (with icon) is loaded. 556 // Called when the app's ShortcutInfo (with icon) is loaded.
556 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( 557 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded(
557 const ShellIntegration::ShortcutInfo& shortcut_info) { 558 const ShellIntegration::ShortcutInfo& shortcut_info) {
558 shortcut_info_ = shortcut_info; 559 shortcut_info_ = shortcut_info;
559 560
560 CHECK(app_info_); 561 CHECK(app_info_);
561 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); 562 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
562 } 563 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698