| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" | 7 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" |
| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 if (requested_favicons_.find(entry->GetUniqueID()) != | 244 if (requested_favicons_.find(entry->GetUniqueID()) != |
| 245 requested_favicons_.end()) { | 245 requested_favicons_.end()) { |
| 246 return; | 246 return; |
| 247 } | 247 } |
| 248 requested_favicons_.insert(entry->GetUniqueID()); | 248 requested_favicons_.insert(entry->GetUniqueID()); |
| 249 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( | 249 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
| 250 browser_->profile(), Profile::EXPLICIT_ACCESS); | 250 browser_->profile(), Profile::EXPLICIT_ACCESS); |
| 251 if (!favicon_service) | 251 if (!favicon_service) |
| 252 return; | 252 return; |
| 253 FaviconService::Handle handle = favicon_service->GetFaviconImageForURL( | 253 FaviconService::Handle handle = favicon_service->GetFaviconImageForURL( |
| 254 browser_->profile(), entry->GetURL(), history::FAVICON, | 254 FaviconService::FaviconForURLParams(browser_->profile(), entry->GetURL(), |
| 255 gfx::kFaviconSize, &load_consumer_, | 255 history::FAVICON, gfx::kFaviconSize, &load_consumer_), |
| 256 base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, | 256 base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, |
| 257 base::Unretained(this))); | 257 base::Unretained(this))); |
| 258 load_consumer_.SetClientData(favicon_service, handle, entry->GetUniqueID()); | 258 load_consumer_.SetClientData(favicon_service, handle, entry->GetUniqueID()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void BackForwardMenuModel::OnFavIconDataAvailable( | 261 void BackForwardMenuModel::OnFavIconDataAvailable( |
| 262 FaviconService::Handle handle, | 262 FaviconService::Handle handle, |
| 263 const history::FaviconImageResult& image_result) { | 263 const history::FaviconImageResult& image_result) { |
| 264 if (!image_result.image.IsEmpty()) { | 264 if (!image_result.image.IsEmpty()) { |
| 265 int unique_id = load_consumer_.GetClientDataForCurrentRequest(); | 265 int unique_id = load_consumer_.GetClientDataForCurrentRequest(); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 metric_string += "ForwardMenu_"; | 470 metric_string += "ForwardMenu_"; |
| 471 else | 471 else |
| 472 metric_string += "BackMenu_"; | 472 metric_string += "BackMenu_"; |
| 473 metric_string += action; | 473 metric_string += action; |
| 474 if (index != -1) { | 474 if (index != -1) { |
| 475 // +1 is for historical reasons (indices used to start at 1). | 475 // +1 is for historical reasons (indices used to start at 1). |
| 476 metric_string += base::IntToString(index + 1); | 476 metric_string += base::IntToString(index + 1); |
| 477 } | 477 } |
| 478 return metric_string; | 478 return metric_string; |
| 479 } | 479 } |
| OLD | NEW |