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/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/favicon/favicon_handler.h" | 8 #include "chrome/browser/favicon/favicon_handler.h" |
9 #include "chrome/browser/favicon/favicon_service_factory.h" | 9 #include "chrome/browser/favicon/favicon_service_factory.h" |
10 #include "chrome/browser/favicon/favicon_util.h" | 10 #include "chrome/browser/favicon/favicon_util.h" |
(...skipping 19 matching lines...) Expand all Loading... |
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); | 36 DEFINE_WEB_CONTENTS_USER_DATA_KEY(FaviconTabHelper); |
37 | 37 |
38 FaviconTabHelper::FaviconTabHelper(WebContents* web_contents) | 38 FaviconTabHelper::FaviconTabHelper(WebContents* web_contents) |
39 : content::WebContentsObserver(web_contents), | 39 : content::WebContentsObserver(web_contents), |
| 40 driver_(web_contents), |
40 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())) { | 41 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())) { |
41 favicon_handler_.reset(new FaviconHandler(profile_, this, | 42 favicon_handler_.reset( |
42 FaviconHandler::FAVICON)); | 43 new FaviconHandler(profile_, &driver_, this, FaviconHandler::FAVICON)); |
43 if (chrome::kEnableTouchIcon) | 44 if (chrome::kEnableTouchIcon) |
44 touch_icon_handler_.reset(new FaviconHandler(profile_, this, | 45 touch_icon_handler_.reset( |
45 FaviconHandler::TOUCH)); | 46 new FaviconHandler(profile_, &driver_, this, FaviconHandler::TOUCH)); |
46 } | 47 } |
47 | 48 |
48 FaviconTabHelper::~FaviconTabHelper() { | 49 FaviconTabHelper::~FaviconTabHelper() { |
49 } | 50 } |
50 | 51 |
51 void FaviconTabHelper::FetchFavicon(const GURL& url) { | 52 void FaviconTabHelper::FetchFavicon(const GURL& url) { |
52 favicon_handler_->FetchFavicon(url); | 53 favicon_handler_->FetchFavicon(url); |
53 if (touch_icon_handler_.get()) | 54 if (touch_icon_handler_.get()) |
54 touch_icon_handler_->FetchFavicon(url); | 55 touch_icon_handler_->FetchFavicon(url); |
55 } | 56 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 favicon_service->UnableToDownloadFavicon(image_url); | 203 favicon_service->UnableToDownloadFavicon(image_url); |
203 } | 204 } |
204 | 205 |
205 favicon_handler_->OnDidDownloadFavicon( | 206 favicon_handler_->OnDidDownloadFavicon( |
206 id, image_url, bitmaps, original_bitmap_sizes); | 207 id, image_url, bitmaps, original_bitmap_sizes); |
207 if (touch_icon_handler_.get()) { | 208 if (touch_icon_handler_.get()) { |
208 touch_icon_handler_->OnDidDownloadFavicon( | 209 touch_icon_handler_->OnDidDownloadFavicon( |
209 id, image_url, bitmaps, original_bitmap_sizes); | 210 id, image_url, bitmaps, original_bitmap_sizes); |
210 } | 211 } |
211 } | 212 } |
OLD | NEW |