| 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_service.h" | 10 #include "chrome/browser/history/history_service.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 service->SetFavicons(entry->GetURL(), favicon.url, history::FAVICON, | 126 service->SetFavicons(entry->GetURL(), favicon.url, history::FAVICON, |
| 127 favicon.image); | 127 favicon.image); |
| 128 } | 128 } |
| 129 | 129 |
| 130 NavigationEntry* FaviconTabHelper::GetActiveEntry() { | 130 NavigationEntry* FaviconTabHelper::GetActiveEntry() { |
| 131 return web_contents()->GetController().GetActiveEntry(); | 131 return web_contents()->GetController().GetActiveEntry(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 int FaviconTabHelper::StartDownload(const GURL& url, int image_size) { | 134 int FaviconTabHelper::StartDownload(const GURL& url, int image_size) { |
| 135 return web_contents()->DownloadFavicon(url, image_size, | 135 return web_contents()->DownloadImage(url, image_size, |
| 136 base::Bind(&FaviconTabHelper::DidDownloadFavicon, | 136 base::Bind(&FaviconTabHelper::DidDownloadFavicon, |
| 137 base::Unretained(this))); | 137 base::Unretained(this))); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void FaviconTabHelper::NotifyFaviconUpdated(bool icon_url_changed) { | 140 void FaviconTabHelper::NotifyFaviconUpdated(bool icon_url_changed) { |
| 141 content::NotificationService::current()->Notify( | 141 content::NotificationService::current()->Notify( |
| 142 chrome::NOTIFICATION_FAVICON_UPDATED, | 142 chrome::NOTIFICATION_FAVICON_UPDATED, |
| 143 content::Source<WebContents>(web_contents()), | 143 content::Source<WebContents>(web_contents()), |
| 144 content::Details<bool>(&icon_url_changed)); | 144 content::Details<bool>(&icon_url_changed)); |
| 145 web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); | 145 web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 const GURL& image_url, | 177 const GURL& image_url, |
| 178 int requested_size, | 178 int requested_size, |
| 179 const std::vector<SkBitmap>& bitmaps) { | 179 const std::vector<SkBitmap>& bitmaps) { |
| 180 favicon_handler_->OnDidDownloadFavicon( | 180 favicon_handler_->OnDidDownloadFavicon( |
| 181 id, image_url, requested_size, bitmaps); | 181 id, image_url, requested_size, bitmaps); |
| 182 if (touch_icon_handler_.get()) { | 182 if (touch_icon_handler_.get()) { |
| 183 touch_icon_handler_->OnDidDownloadFavicon( | 183 touch_icon_handler_->OnDidDownloadFavicon( |
| 184 id, image_url, requested_size, bitmaps); | 184 id, image_url, requested_size, bitmaps); |
| 185 } | 185 } |
| 186 } | 186 } |
| OLD | NEW |