| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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->GetFaviconImageForURL( |
| 258 FaviconService::FaviconForURLParams(browser_->profile(), | 258 FaviconService::FaviconForURLParams(entry->GetURL(), |
| 259 entry->GetURL(), | |
| 260 chrome::FAVICON, | 259 chrome::FAVICON, |
| 261 gfx::kFaviconSize), | 260 gfx::kFaviconSize), |
| 262 base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, | 261 base::Bind(&BackForwardMenuModel::OnFavIconDataAvailable, |
| 263 base::Unretained(this), | 262 base::Unretained(this), |
| 264 entry->GetUniqueID()), | 263 entry->GetUniqueID()), |
| 265 &cancelable_task_tracker_); | 264 &cancelable_task_tracker_); |
| 266 } | 265 } |
| 267 | 266 |
| 268 void BackForwardMenuModel::OnFavIconDataAvailable( | 267 void BackForwardMenuModel::OnFavIconDataAvailable( |
| 269 int navigation_entry_unique_id, | 268 int navigation_entry_unique_id, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 metric_string += "ForwardMenu_"; | 475 metric_string += "ForwardMenu_"; |
| 477 else | 476 else |
| 478 metric_string += "BackMenu_"; | 477 metric_string += "BackMenu_"; |
| 479 metric_string += action; | 478 metric_string += action; |
| 480 if (index != -1) { | 479 if (index != -1) { |
| 481 // +1 is for historical reasons (indices used to start at 1). | 480 // +1 is for historical reasons (indices used to start at 1). |
| 482 metric_string += base::IntToString(index + 1); | 481 metric_string += base::IntToString(index + 1); |
| 483 } | 482 } |
| 484 return metric_string; | 483 return metric_string; |
| 485 } | 484 } |
| OLD | NEW |