| 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/defaults.h" | |
| 8 #include "chrome/browser/favicon/favicon_handler.h" | 7 #include "chrome/browser/favicon/favicon_handler.h" |
| 9 #include "chrome/browser/history/history.h" | 8 #include "chrome/browser/history/history.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/chrome_constants.h" |
| 11 #include "chrome/common/icon_messages.h" | 11 #include "chrome/common/icon_messages.h" |
| 12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 13 #include "content/browser/webui/web_ui.h" | 13 #include "content/browser/webui/web_ui.h" |
| 14 #include "ui/gfx/codec/png_codec.h" | 14 #include "ui/gfx/codec/png_codec.h" |
| 15 | 15 |
| 16 FaviconTabHelper::FaviconTabHelper(TabContents* tab_contents) | 16 FaviconTabHelper::FaviconTabHelper(TabContents* tab_contents) |
| 17 : TabContentsObserver(tab_contents) { | 17 : TabContentsObserver(tab_contents) { |
| 18 favicon_handler_.reset(new FaviconHandler(tab_contents, | 18 favicon_handler_.reset(new FaviconHandler(tab_contents, |
| 19 FaviconHandler::FAVICON)); | 19 FaviconHandler::FAVICON)); |
| 20 if (browser_defaults::kEnableTouchIcon) | 20 if (chrome::kEnableTouchIcon) |
| 21 touch_icon_handler_.reset(new FaviconHandler(tab_contents, | 21 touch_icon_handler_.reset(new FaviconHandler(tab_contents, |
| 22 FaviconHandler::TOUCH)); | 22 FaviconHandler::TOUCH)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 FaviconTabHelper::~FaviconTabHelper() { | 25 FaviconTabHelper::~FaviconTabHelper() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 void FaviconTabHelper::FetchFavicon(const GURL& url) { | 28 void FaviconTabHelper::FetchFavicon(const GURL& url) { |
| 29 favicon_handler_->FetchFavicon(url); | 29 favicon_handler_->FetchFavicon(url); |
| 30 if (touch_icon_handler_.get()) | 30 if (touch_icon_handler_.get()) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, image); | 149 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, image); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void FaviconTabHelper::OnUpdateFaviconURL( | 152 void FaviconTabHelper::OnUpdateFaviconURL( |
| 153 int32 page_id, | 153 int32 page_id, |
| 154 const std::vector<FaviconURL>& candidates) { | 154 const std::vector<FaviconURL>& candidates) { |
| 155 favicon_handler_->OnUpdateFaviconURL(page_id, candidates); | 155 favicon_handler_->OnUpdateFaviconURL(page_id, candidates); |
| 156 if (touch_icon_handler_.get()) | 156 if (touch_icon_handler_.get()) |
| 157 touch_icon_handler_->OnUpdateFaviconURL(page_id, candidates); | 157 touch_icon_handler_->OnUpdateFaviconURL(page_id, candidates); |
| 158 } | 158 } |
| OLD | NEW |