OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/browser/ui/webui/history/favicon_source.h" | 5 #include "ios/chrome/browser/ui/webui/history/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" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "components/favicon_base/favicon_url_parser.h" | 12 #include "components/favicon_base/favicon_url_parser.h" |
13 #include "components/history/core/browser/top_sites.h" | 13 #include "components/history/core/browser/top_sites.h" |
14 #include "components/keyed_service/core/service_access_type.h" | 14 #include "components/keyed_service/core/service_access_type.h" |
15 #include "components/sync_driver/sync_service.h" | 15 #include "components/sync/driver/sync_service.h" |
16 #include "components/sync_sessions/open_tabs_ui_delegate.h" | 16 #include "components/sync_sessions/open_tabs_ui_delegate.h" |
17 #include "net/url_request/url_request.h" | 17 #include "net/url_request/url_request.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/base/layout.h" | 19 #include "ui/base/layout.h" |
20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/base/webui/web_ui_util.h" | 21 #include "ui/base/webui/web_ui_util.h" |
22 #include "ui/resources/grit/ui_resources.h" | 22 #include "ui/resources/grit/ui_resources.h" |
23 | 23 |
24 FaviconSource::IconRequest::IconRequest() | 24 FaviconSource::IconRequest::IconRequest() |
25 : size_in_dip(gfx::kFaviconSize), device_scale_factor(1.0f) {} | 25 : size_in_dip(gfx::kFaviconSize), device_scale_factor(1.0f) {} |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 ui::ScaleFactor resource_scale_factor = | 174 ui::ScaleFactor resource_scale_factor = |
175 ui::GetSupportedScaleFactor(icon_request.device_scale_factor); | 175 ui::GetSupportedScaleFactor(icon_request.device_scale_factor); |
176 default_favicon = | 176 default_favicon = |
177 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 177 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
178 resource_id, resource_scale_factor); | 178 resource_id, resource_scale_factor); |
179 default_favicons_[favicon_index] = default_favicon; | 179 default_favicons_[favicon_index] = default_favicon; |
180 } | 180 } |
181 | 181 |
182 icon_request.callback.Run(default_favicon); | 182 icon_request.callback.Run(default_favicon); |
183 } | 183 } |
OLD | NEW |