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 <cmath> | 7 #include <cmath> |
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 24 matching lines...) Expand all Loading... |
35 const content::URLDataSource::GotDataCallback& cb, | 35 const content::URLDataSource::GotDataCallback& cb, |
36 const GURL& path, | 36 const GURL& path, |
37 int size, | 37 int size, |
38 float scale) | 38 float scale) |
39 : callback(cb), | 39 : callback(cb), |
40 request_path(path), | 40 request_path(path), |
41 size_in_dip(size), | 41 size_in_dip(size), |
42 device_scale_factor(scale) { | 42 device_scale_factor(scale) { |
43 } | 43 } |
44 | 44 |
| 45 FaviconSource::IconRequest::IconRequest(const IconRequest& other) = default; |
| 46 |
45 FaviconSource::IconRequest::~IconRequest() { | 47 FaviconSource::IconRequest::~IconRequest() { |
46 } | 48 } |
47 | 49 |
48 FaviconSource::FaviconSource(Profile* profile, IconType type) | 50 FaviconSource::FaviconSource(Profile* profile, IconType type) |
49 : profile_(profile->GetOriginalProfile()), | 51 : profile_(profile->GetOriginalProfile()), |
50 icon_types_(type == FAVICON ? favicon_base::FAVICON | 52 icon_types_(type == FAVICON ? favicon_base::FAVICON |
51 : favicon_base::TOUCH_PRECOMPOSED_ICON | | 53 : favicon_base::TOUCH_PRECOMPOSED_ICON | |
52 favicon_base::TOUCH_ICON | | 54 favicon_base::TOUCH_ICON | |
53 favicon_base::FAVICON) {} | 55 favicon_base::FAVICON) {} |
54 | 56 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 ui::ScaleFactor resource_scale_factor = | 204 ui::ScaleFactor resource_scale_factor = |
203 ui::GetSupportedScaleFactor(icon_request.device_scale_factor); | 205 ui::GetSupportedScaleFactor(icon_request.device_scale_factor); |
204 default_favicon = | 206 default_favicon = |
205 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 207 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
206 resource_id, resource_scale_factor); | 208 resource_id, resource_scale_factor); |
207 default_favicons_[favicon_index] = default_favicon; | 209 default_favicons_[favicon_index] = default_favicon; |
208 } | 210 } |
209 | 211 |
210 icon_request.callback.Run(default_favicon); | 212 icon_request.callback.Run(default_favicon); |
211 } | 213 } |
OLD | NEW |