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_service.h" | 9 #include "components/favicon/core/favicon_service.h" |
10 #include "components/favicon/core/favicon_url.h" | 10 #include "components/favicon/core/favicon_url.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 void ContentFaviconDriver::SetActiveFaviconURL(const GURL& url) { | 128 void ContentFaviconDriver::SetActiveFaviconURL(const GURL& url) { |
129 GetFaviconStatus().url = url; | 129 GetFaviconStatus().url = url; |
130 } | 130 } |
131 | 131 |
132 void ContentFaviconDriver::SetActiveFaviconImage(const gfx::Image& image) { | 132 void ContentFaviconDriver::SetActiveFaviconImage(const gfx::Image& image) { |
133 GetFaviconStatus().image = image; | 133 GetFaviconStatus().image = image; |
134 } | 134 } |
135 | 135 |
| 136 bool ContentFaviconDriver::ShouldSendFaviconAvailableNotifications() { |
| 137 return true; |
| 138 } |
| 139 |
136 content::FaviconStatus& ContentFaviconDriver::GetFaviconStatus() { | 140 content::FaviconStatus& ContentFaviconDriver::GetFaviconStatus() { |
137 DCHECK(web_contents()->GetController().GetLastCommittedEntry()); | 141 DCHECK(web_contents()->GetController().GetLastCommittedEntry()); |
138 return web_contents()->GetController().GetLastCommittedEntry()->GetFavicon(); | 142 return web_contents()->GetController().GetLastCommittedEntry()->GetFavicon(); |
139 } | 143 } |
140 | 144 |
141 ContentFaviconDriver::ContentFaviconDriver( | 145 ContentFaviconDriver::ContentFaviconDriver( |
142 content::WebContents* web_contents, | 146 content::WebContents* web_contents, |
143 FaviconService* favicon_service, | 147 FaviconService* favicon_service, |
144 history::HistoryService* history_service, | 148 history::HistoryService* history_service, |
145 bookmarks::BookmarkModel* bookmark_model) | 149 bookmarks::BookmarkModel* bookmark_model) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // redownloaded. | 198 // redownloaded. |
195 GURL url = details.entry->GetURL(); | 199 GURL url = details.entry->GetURL(); |
196 if (url != bypass_cache_page_url_) | 200 if (url != bypass_cache_page_url_) |
197 bypass_cache_page_url_ = GURL(); | 201 bypass_cache_page_url_ = GURL(); |
198 | 202 |
199 // Get the favicon, either from history or request it from the net. | 203 // Get the favicon, either from history or request it from the net. |
200 FetchFavicon(url); | 204 FetchFavicon(url); |
201 } | 205 } |
202 | 206 |
203 } // namespace favicon | 207 } // namespace favicon |
OLD | NEW |