| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/history/history.h" | 8 #include "chrome/browser/history/history.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 touch_icon_handler_->OnUpdateFaviconURL(page_id, candidates); | 135 touch_icon_handler_->OnUpdateFaviconURL(page_id, candidates); |
| 136 } | 136 } |
| 137 | 137 |
| 138 NavigationEntry* FaviconTabHelper::GetActiveEntry() { | 138 NavigationEntry* FaviconTabHelper::GetActiveEntry() { |
| 139 return web_contents()->GetController().GetActiveEntry(); | 139 return web_contents()->GetController().GetActiveEntry(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void FaviconTabHelper::StartDownload(int id, const GURL& url, int image_size) { | 142 void FaviconTabHelper::StartDownload(int id, const GURL& url, int image_size) { |
| 143 RenderViewHost* host = web_contents()->GetRenderViewHost(); | 143 RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 144 host->Send(new IconMsg_DownloadFavicon( | 144 host->Send(new IconMsg_DownloadFavicon( |
| 145 host->routing_id(), id, url, image_size)); | 145 host->GetRoutingID(), id, url, image_size)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void FaviconTabHelper::NotifyFaviconUpdated() { | 148 void FaviconTabHelper::NotifyFaviconUpdated() { |
| 149 content::NotificationService::current()->Notify( | 149 content::NotificationService::current()->Notify( |
| 150 chrome::NOTIFICATION_FAVICON_UPDATED, | 150 chrome::NOTIFICATION_FAVICON_UPDATED, |
| 151 content::Source<WebContents>(web_contents()), | 151 content::Source<WebContents>(web_contents()), |
| 152 content::NotificationService::NoDetails()); | 152 content::NotificationService::NoDetails()); |
| 153 web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); | 153 web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); |
| 154 } | 154 } |
| 155 | 155 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 184 | 184 |
| 185 void FaviconTabHelper::OnDidDownloadFavicon(int id, | 185 void FaviconTabHelper::OnDidDownloadFavicon(int id, |
| 186 const GURL& image_url, | 186 const GURL& image_url, |
| 187 bool errored, | 187 bool errored, |
| 188 const SkBitmap& image) { | 188 const SkBitmap& image) { |
| 189 gfx::Image favicon(new SkBitmap(image)); | 189 gfx::Image favicon(new SkBitmap(image)); |
| 190 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); | 190 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); |
| 191 if (touch_icon_handler_.get()) | 191 if (touch_icon_handler_.get()) |
| 192 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); | 192 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); |
| 193 } | 193 } |
| OLD | NEW |