OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/possible_url_model.h" | 5 #include "chrome/browser/possible_url_model.h" |
6 | 6 |
| 7 #include "app/gfx/codec/png_codec.h" |
7 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
9 #include "app/table_model_observer.h" | 10 #include "app/table_model_observer.h" |
10 #include "base/gfx/png_decoder.h" | |
11 #include "chrome/browser/cancelable_request.h" | 11 #include "chrome/browser/cancelable_request.h" |
12 #include "chrome/browser/favicon_service.h" | 12 #include "chrome/browser/favicon_service.h" |
13 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "grit/app_resources.h" | 15 #include "grit/app_resources.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 | 17 |
18 using base::Time; | 18 using base::Time; |
19 using base::TimeDelta; | 19 using base::TimeDelta; |
20 | 20 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 bool fav_icon_available, | 169 bool fav_icon_available, |
170 scoped_refptr<RefCountedBytes> data, | 170 scoped_refptr<RefCountedBytes> data, |
171 bool expired, | 171 bool expired, |
172 GURL icon_url) { | 172 GURL icon_url) { |
173 if (profile_) { | 173 if (profile_) { |
174 FaviconService* favicon_service = | 174 FaviconService* favicon_service = |
175 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); | 175 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); |
176 size_t index = consumer_.GetClientData(favicon_service, h); | 176 size_t index = consumer_.GetClientData(favicon_service, h); |
177 if (fav_icon_available) { | 177 if (fav_icon_available) { |
178 // The decoder will leave our bitmap empty on error. | 178 // The decoder will leave our bitmap empty on error. |
179 PNGDecoder::Decode(&data->data, &(fav_icon_map_[index])); | 179 gfx::PNGCodec::Decode(&data->data, &(fav_icon_map_[index])); |
180 | 180 |
181 // Notify the observer. | 181 // Notify the observer. |
182 if (!fav_icon_map_[index].isNull() && observer_) | 182 if (!fav_icon_map_[index].isNull() && observer_) |
183 observer_->OnItemsChanged(static_cast<int>(index), 1); | 183 observer_->OnItemsChanged(static_cast<int>(index), 1); |
184 } | 184 } |
185 } | 185 } |
186 } | 186 } |
OLD | NEW |