| 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/favicon/favicon_tab_helper.h" | 5 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/favicon/favicon_handler.h" | 7 #include "chrome/browser/favicon/favicon_handler.h" |
| 8 #include "chrome/browser/favicon/favicon_service_factory.h" | 8 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 9 #include "chrome/browser/favicon/favicon_util.h" | 9 #include "chrome/browser/favicon/favicon_util.h" |
| 10 #include "chrome/browser/history/history.h" | 10 #include "chrome/browser/history/history.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ui/gfx/codec/png_codec.h" | 26 #include "ui/gfx/codec/png_codec.h" |
| 27 #include "ui/gfx/image/image.h" | 27 #include "ui/gfx/image/image.h" |
| 28 #include "ui/gfx/image/image_skia.h" | 28 #include "ui/gfx/image/image_skia.h" |
| 29 #include "ui/gfx/image/image_skia_rep.h" | 29 #include "ui/gfx/image/image_skia_rep.h" |
| 30 | 30 |
| 31 using content::FaviconStatus; | 31 using content::FaviconStatus; |
| 32 using content::NavigationController; | 32 using content::NavigationController; |
| 33 using content::NavigationEntry; | 33 using content::NavigationEntry; |
| 34 using content::WebContents; | 34 using content::WebContents; |
| 35 | 35 |
| 36 DEFINE_WEB_CONTENTS_USER_DATA_KEY(FaviconTabHelper) |
| 37 |
| 36 FaviconTabHelper::FaviconTabHelper(WebContents* web_contents) | 38 FaviconTabHelper::FaviconTabHelper(WebContents* web_contents) |
| 37 : content::WebContentsObserver(web_contents), | 39 : content::WebContentsObserver(web_contents), |
| 38 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())) { | 40 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())) { |
| 39 favicon_handler_.reset(new FaviconHandler(profile_, this, | 41 favicon_handler_.reset(new FaviconHandler(profile_, this, |
| 40 FaviconHandler::FAVICON)); | 42 FaviconHandler::FAVICON)); |
| 41 if (chrome::kEnableTouchIcon) | 43 if (chrome::kEnableTouchIcon) |
| 42 touch_icon_handler_.reset(new FaviconHandler(profile_, this, | 44 touch_icon_handler_.reset(new FaviconHandler(profile_, this, |
| 43 FaviconHandler::TOUCH)); | 45 FaviconHandler::TOUCH)); |
| 44 } | 46 } |
| 45 | 47 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 bool errored, | 193 bool errored, |
| 192 int requested_size, | 194 int requested_size, |
| 193 const std::vector<SkBitmap>& bitmaps) { | 195 const std::vector<SkBitmap>& bitmaps) { |
| 194 favicon_handler_->OnDidDownloadFavicon( | 196 favicon_handler_->OnDidDownloadFavicon( |
| 195 id, image_url, errored, requested_size, bitmaps); | 197 id, image_url, errored, requested_size, bitmaps); |
| 196 if (touch_icon_handler_.get()) { | 198 if (touch_icon_handler_.get()) { |
| 197 touch_icon_handler_->OnDidDownloadFavicon( | 199 touch_icon_handler_->OnDidDownloadFavicon( |
| 198 id, image_url, errored, requested_size, bitmaps); | 200 id, image_url, errored, requested_size, bitmaps); |
| 199 } | 201 } |
| 200 } | 202 } |
| OLD | NEW |