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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 FaviconSource::~FaviconSource() { | 76 FaviconSource::~FaviconSource() { |
77 } | 77 } |
78 | 78 |
79 std::string FaviconSource::GetSource() { | 79 std::string FaviconSource::GetSource() { |
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 int render_process_id, |
| 87 int render_view_id, |
87 const content::URLDataSource::GotDataCallback& callback) { | 88 const content::URLDataSource::GotDataCallback& callback) { |
88 FaviconService* favicon_service = | 89 FaviconService* favicon_service = |
89 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 90 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
90 if (!favicon_service || raw_path.empty()) { | 91 if (!favicon_service || raw_path.empty()) { |
91 SendDefaultResponse(callback); | 92 SendDefaultResponse(callback); |
92 return; | 93 return; |
93 } | 94 } |
94 | 95 |
95 // Translate to regular path if |raw_path| is of the form | 96 // Translate to regular path if |raw_path| is of the form |
96 // chrome-search://favicon/<most_visited_item_id>, where | 97 // chrome-search://favicon/<most_visited_item_id>, where |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 279 |
279 if (!default_favicon) { | 280 if (!default_favicon) { |
280 ui::ScaleFactor scale_factor = icon_request.scale_factor; | 281 ui::ScaleFactor scale_factor = icon_request.scale_factor; |
281 default_favicon = ResourceBundle::GetSharedInstance() | 282 default_favicon = ResourceBundle::GetSharedInstance() |
282 .LoadDataResourceBytesForScale(resource_id, scale_factor); | 283 .LoadDataResourceBytesForScale(resource_id, scale_factor); |
283 default_favicons_[favicon_index] = default_favicon; | 284 default_favicons_[favicon_index] = default_favicon; |
284 } | 285 } |
285 | 286 |
286 icon_request.callback.Run(default_favicon); | 287 icon_request.callback.Run(default_favicon); |
287 } | 288 } |
OLD | NEW |