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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_icon_source.cc

Issue 56143002: Make FaviconService() use Porfile as parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test but break the DEPS Created 7 years, 1 month 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
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/webui/extensions/extension_icon_source.h" 5 #include "chrome/browser/ui/webui/extensions/extension_icon_source.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/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); 213 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
214 // Fall back to the default icons if the service isn't available. 214 // Fall back to the default icons if the service isn't available.
215 if (favicon_service == NULL) { 215 if (favicon_service == NULL) {
216 LoadDefaultImage(request_id); 216 LoadDefaultImage(request_id);
217 return; 217 return;
218 } 218 }
219 219
220 GURL favicon_url = 220 GURL favicon_url =
221 AppLaunchInfo::GetFullLaunchURL(GetData(request_id)->extension); 221 AppLaunchInfo::GetFullLaunchURL(GetData(request_id)->extension);
222 favicon_service->GetRawFaviconForURL( 222 favicon_service->GetRawFaviconForURL(
223 FaviconService::FaviconForURLParams( 223 FaviconService::FaviconForURLParams(favicon_url, chrome::FAVICON,
224 profile_, favicon_url, chrome::FAVICON, gfx::kFaviconSize), 224 gfx::kFaviconSize),
225 ui::SCALE_FACTOR_100P, 225 ui::SCALE_FACTOR_100P,
226 base::Bind(&ExtensionIconSource::OnFaviconDataAvailable, 226 base::Bind(&ExtensionIconSource::OnFaviconDataAvailable,
227 base::Unretained(this), request_id), 227 base::Unretained(this), request_id),
228 &cancelable_task_tracker_); 228 &cancelable_task_tracker_);
229 } 229 }
230 230
231 void ExtensionIconSource::OnFaviconDataAvailable( 231 void ExtensionIconSource::OnFaviconDataAvailable(
232 int request_id, 232 int request_id,
233 const chrome::FaviconBitmapResult& bitmap_result) { 233 const chrome::FaviconBitmapResult& bitmap_result) {
234 ExtensionIconRequest* request = GetData(request_id); 234 ExtensionIconRequest* request = GetData(request_id);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 std::map<int, ExtensionIconRequest*>::iterator i = 339 std::map<int, ExtensionIconRequest*>::iterator i =
340 request_map_.find(request_id); 340 request_map_.find(request_id);
341 if (i == request_map_.end()) 341 if (i == request_map_.end())
342 return; 342 return;
343 343
344 delete i->second; 344 delete i->second;
345 request_map_.erase(i); 345 request_map_.erase(i);
346 } 346 }
347 347
348 } // namespace extensions 348 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc ('k') | chrome/browser/ui/webui/favicon_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698