| 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 "chrome/browser/ui/toolbar/back_forward_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/back_forward_menu_model.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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if (requested_favicons_.find(entry->GetUniqueID()) != | 247 if (requested_favicons_.find(entry->GetUniqueID()) != |
| 248 requested_favicons_.end()) { | 248 requested_favicons_.end()) { |
| 249 return; | 249 return; |
| 250 } | 250 } |
| 251 requested_favicons_.insert(entry->GetUniqueID()); | 251 requested_favicons_.insert(entry->GetUniqueID()); |
| 252 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( | 252 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
| 253 browser_->profile(), Profile::EXPLICIT_ACCESS); | 253 browser_->profile(), Profile::EXPLICIT_ACCESS); |
| 254 if (!favicon_service) | 254 if (!favicon_service) |
| 255 return; | 255 return; |
| 256 | 256 |
| 257 favicon_service->GetFaviconImageForURL( | 257 favicon_service->GetFaviconImageForPageURL( |
| 258 FaviconService::FaviconForURLParams( | 258 FaviconService::FaviconForPageURLParams( |
| 259 entry->GetURL(), favicon_base::FAVICON, gfx::kFaviconSize), | 259 entry->GetURL(), favicon_base::FAVICON, gfx::kFaviconSize), |
| 260 base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, | 260 base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, |
| 261 base::Unretained(this), | 261 base::Unretained(this), |
| 262 entry->GetUniqueID()), | 262 entry->GetUniqueID()), |
| 263 &cancelable_task_tracker_); | 263 &cancelable_task_tracker_); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void BackForwardMenuModel::OnFavIconDataAvailable( | 266 void BackForwardMenuModel::OnFavIconDataAvailable( |
| 267 int navigation_entry_unique_id, | 267 int navigation_entry_unique_id, |
| 268 const favicon_base::FaviconImageResult& image_result) { | 268 const favicon_base::FaviconImageResult& image_result) { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 metric_string += "ForwardMenu_"; | 474 metric_string += "ForwardMenu_"; |
| 475 else | 475 else |
| 476 metric_string += "BackMenu_"; | 476 metric_string += "BackMenu_"; |
| 477 metric_string += action; | 477 metric_string += action; |
| 478 if (index != -1) { | 478 if (index != -1) { |
| 479 // +1 is for historical reasons (indices used to start at 1). | 479 // +1 is for historical reasons (indices used to start at 1). |
| 480 metric_string += base::IntToString(index + 1); | 480 metric_string += base::IntToString(index + 1); |
| 481 } | 481 } |
| 482 return metric_string; | 482 return metric_string; |
| 483 } | 483 } |
| OLD | NEW |