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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 FaviconSource::FaviconSource(Profile* profile, IconType type) | 69 FaviconSource::FaviconSource(Profile* profile, IconType type) |
70 : profile_(profile->GetOriginalProfile()), | 70 : profile_(profile->GetOriginalProfile()), |
71 icon_types_(type == FAVICON ? history::FAVICON : | 71 icon_types_(type == FAVICON ? history::FAVICON : |
72 history::TOUCH_PRECOMPOSED_ICON | history::TOUCH_ICON | | 72 history::TOUCH_PRECOMPOSED_ICON | history::TOUCH_ICON | |
73 history::FAVICON) { | 73 history::FAVICON) { |
74 } | 74 } |
75 | 75 |
76 FaviconSource::~FaviconSource() { | 76 FaviconSource::~FaviconSource() { |
77 } | 77 } |
78 | 78 |
79 std::string FaviconSource::GetSource() { | 79 std::string FaviconSource::GetSource() const { |
80 return icon_types_ == history::FAVICON ? | 80 return icon_types_ == history::FAVICON ? |
81 chrome::kChromeUIFaviconHost : chrome::kChromeUITouchIconHost; | 81 chrome::kChromeUIFaviconHost : chrome::kChromeUITouchIconHost; |
82 } | 82 } |
83 | 83 |
84 void FaviconSource::StartDataRequest( | 84 void FaviconSource::StartDataRequest( |
85 const std::string& raw_path, | 85 const std::string& raw_path, |
86 bool is_incognito, | 86 bool is_incognito, |
87 const content::URLDataSource::GotDataCallback& callback) { | 87 const content::URLDataSource::GotDataCallback& callback) { |
88 FaviconService* favicon_service = | 88 FaviconService* favicon_service = |
89 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 89 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 if (!default_favicon) { | 279 if (!default_favicon) { |
280 ui::ScaleFactor scale_factor = icon_request.scale_factor; | 280 ui::ScaleFactor scale_factor = icon_request.scale_factor; |
281 default_favicon = ResourceBundle::GetSharedInstance() | 281 default_favicon = ResourceBundle::GetSharedInstance() |
282 .LoadDataResourceBytesForScale(resource_id, scale_factor); | 282 .LoadDataResourceBytesForScale(resource_id, scale_factor); |
283 default_favicons_[favicon_index] = default_favicon; | 283 default_favicons_[favicon_index] = default_favicon; |
284 } | 284 } |
285 | 285 |
286 icon_request.callback.Run(default_favicon); | 286 icon_request.callback.Run(default_favicon); |
287 } | 287 } |
OLD | NEW |