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/webui/favicon_source.h" | 5 #include "chrome/browser/ui/webui/favicon_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/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/favicon/favicon_service_factory.h" | 10 #include "chrome/browser/favicon/favicon_service_factory.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 l10n_util::GetStringUTF8(history::kPrepopulatedPages[i].url_id)) { | 101 l10n_util::GetStringUTF8(history::kPrepopulatedPages[i].url_id)) { |
102 callback.Run( | 102 callback.Run( |
103 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 103 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
104 history::kPrepopulatedPages[i].favicon_id, | 104 history::kPrepopulatedPages[i].favicon_id, |
105 parsed.scale_factor)); | 105 parsed.scale_factor)); |
106 return; | 106 return; |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 favicon_service->GetRawFaviconForURL( | 110 favicon_service->GetRawFaviconForURL( |
111 FaviconService::FaviconForURLParams( | 111 FaviconService::FaviconForURLParams(url, icon_types_, |
112 profile_, url, icon_types_, parsed.size_in_dip), | 112 parsed.size_in_dip), |
113 parsed.scale_factor, | 113 parsed.scale_factor, |
114 base::Bind(&FaviconSource::OnFaviconDataAvailable, | 114 base::Bind(&FaviconSource::OnFaviconDataAvailable, |
115 base::Unretained(this), | 115 base::Unretained(this), |
116 IconRequest(callback, | 116 IconRequest(callback, |
117 url, | 117 url, |
118 parsed.size_in_dip, | 118 parsed.size_in_dip, |
119 parsed.scale_factor)), | 119 parsed.scale_factor)), |
120 &cancelable_task_tracker_); | 120 &cancelable_task_tracker_); |
121 } | 121 } |
122 } | 122 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 if (!default_favicon) { | 196 if (!default_favicon) { |
197 ui::ScaleFactor scale_factor = icon_request.scale_factor; | 197 ui::ScaleFactor scale_factor = icon_request.scale_factor; |
198 default_favicon = ResourceBundle::GetSharedInstance() | 198 default_favicon = ResourceBundle::GetSharedInstance() |
199 .LoadDataResourceBytesForScale(resource_id, scale_factor); | 199 .LoadDataResourceBytesForScale(resource_id, scale_factor); |
200 default_favicons_[favicon_index] = default_favicon; | 200 default_favicons_[favicon_index] = default_favicon; |
201 } | 201 } |
202 | 202 |
203 icon_request.callback.Run(default_favicon); | 203 icon_request.callback.Run(default_favicon); |
204 } | 204 } |
OLD | NEW |