| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/favicon/content/content_favicon_driver.h" | 5 #include "components/favicon/content/content_favicon_driver.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "components/favicon/content/favicon_url_util.h" | 8 #include "components/favicon/content/favicon_url_util.h" |
| 9 #include "components/favicon/core/favicon_url.h" | 9 #include "components/favicon/core/favicon_url.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 void ContentFaviconDriver::SetActiveFaviconURL(const GURL& url) { | 120 void ContentFaviconDriver::SetActiveFaviconURL(const GURL& url) { |
| 121 GetFaviconStatus().url = url; | 121 GetFaviconStatus().url = url; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ContentFaviconDriver::SetActiveFaviconImage(const gfx::Image& image) { | 124 void ContentFaviconDriver::SetActiveFaviconImage(const gfx::Image& image) { |
| 125 GetFaviconStatus().image = image; | 125 GetFaviconStatus().image = image; |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool ContentFaviconDriver::ShouldSendFaviconAvailableNotifications() { |
| 129 return true; |
| 130 } |
| 131 |
| 128 content::FaviconStatus& ContentFaviconDriver::GetFaviconStatus() { | 132 content::FaviconStatus& ContentFaviconDriver::GetFaviconStatus() { |
| 129 DCHECK(web_contents()->GetController().GetLastCommittedEntry()); | 133 DCHECK(web_contents()->GetController().GetLastCommittedEntry()); |
| 130 return web_contents()->GetController().GetLastCommittedEntry()->GetFavicon(); | 134 return web_contents()->GetController().GetLastCommittedEntry()->GetFavicon(); |
| 131 } | 135 } |
| 132 | 136 |
| 133 ContentFaviconDriver::ContentFaviconDriver( | 137 ContentFaviconDriver::ContentFaviconDriver( |
| 134 content::WebContents* web_contents, | 138 content::WebContents* web_contents, |
| 135 FaviconService* favicon_service, | 139 FaviconService* favicon_service, |
| 136 history::HistoryService* history_service, | 140 history::HistoryService* history_service, |
| 137 bookmarks::BookmarkModel* bookmark_model) | 141 bookmarks::BookmarkModel* bookmark_model) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // redownloaded. | 190 // redownloaded. |
| 187 GURL url = details.entry->GetURL(); | 191 GURL url = details.entry->GetURL(); |
| 188 if (url != bypass_cache_page_url_) | 192 if (url != bypass_cache_page_url_) |
| 189 bypass_cache_page_url_ = GURL(); | 193 bypass_cache_page_url_ = GURL(); |
| 190 | 194 |
| 191 // Get the favicon, either from history or request it from the net. | 195 // Get the favicon, either from history or request it from the net. |
| 192 FetchFavicon(url); | 196 FetchFavicon(url); |
| 193 } | 197 } |
| 194 | 198 |
| 195 } // namespace favicon | 199 } // namespace favicon |
| OLD | NEW |