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

Side by Side Diff: chrome/browser/ui/cocoa/history_menu_bridge.mm

Issue 10918065: Introduce structures to reduce the number of arguments in the FaviconService methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove the auxiliary structure for non-URL cases. Created 8 years, 3 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/cocoa/history_menu_bridge.h" 5 #include "chrome/browser/ui/cocoa/history_menu_bridge.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 // Tab navigations don't come with icons, so we always have to request them. 449 // Tab navigations don't come with icons, so we always have to request them.
450 GetFaviconForHistoryItem(item); 450 GetFaviconForHistoryItem(item);
451 451
452 return item; 452 return item;
453 } 453 }
454 454
455 void HistoryMenuBridge::GetFaviconForHistoryItem(HistoryItem* item) { 455 void HistoryMenuBridge::GetFaviconForHistoryItem(HistoryItem* item) {
456 FaviconService* service = 456 FaviconService* service =
457 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); 457 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
458 FaviconService::Handle handle = service->GetFaviconImageForURL( 458 FaviconService::Handle handle = service->GetFaviconImageForURL(
459 profile_, item->url, history::FAVICON, gfx::kFaviconSize, 459 FaviconService::FaviconForURLParams(profile_, item->url, history::FAVICON,
460 &favicon_consumer_, 460 gfx::kFaviconSize, &favicon_consumer_),
461 base::Bind(&HistoryMenuBridge::GotFaviconData, base::Unretained(this))); 461 base::Bind(&HistoryMenuBridge::GotFaviconData, base::Unretained(this)));
462 favicon_consumer_.SetClientData(service, handle, item); 462 favicon_consumer_.SetClientData(service, handle, item);
463 item->icon_handle = handle; 463 item->icon_handle = handle;
464 item->icon_requested = true; 464 item->icon_requested = true;
465 } 465 }
466 466
467 void HistoryMenuBridge::GotFaviconData( 467 void HistoryMenuBridge::GotFaviconData(
468 FaviconService::Handle handle, 468 FaviconService::Handle handle,
469 const history::FaviconImageResult& image_result) { 469 const history::FaviconImageResult& image_result) {
470 // Since we're going to do Cocoa-y things, make sure this is the main thread. 470 // Since we're going to do Cocoa-y things, make sure this is the main thread.
(...skipping 17 matching lines...) Expand all
488 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { 488 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) {
489 DCHECK(item); 489 DCHECK(item);
490 if (item->icon_requested) { 490 if (item->icon_requested) {
491 FaviconService* service = FaviconServiceFactory::GetForProfile( 491 FaviconService* service = FaviconServiceFactory::GetForProfile(
492 profile_, Profile::EXPLICIT_ACCESS); 492 profile_, Profile::EXPLICIT_ACCESS);
493 service->CancelRequest(item->icon_handle); 493 service->CancelRequest(item->icon_handle);
494 item->icon_requested = false; 494 item->icon_requested = false;
495 item->icon_handle = 0; 495 item->icon_handle = 0;
496 } 496 }
497 } 497 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698