| 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 "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "components/favicon/content/favicon_url_util.h" | 9 #include "components/favicon/content/favicon_url_util.h" |
| 10 #include "components/favicon/core/favicon_service.h" | 10 #include "components/favicon/core/favicon_service.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 DCHECK(!candidates.empty()); | 149 DCHECK(!candidates.empty()); |
| 150 | 150 |
| 151 // Ignore the update if there is no last committed navigation entry. This can | 151 // Ignore the update if there is no last committed navigation entry. This can |
| 152 // occur when loading an initially blank page. | 152 // occur when loading an initially blank page. |
| 153 content::NavigationEntry* entry = | 153 content::NavigationEntry* entry = |
| 154 web_contents()->GetController().GetLastCommittedEntry(); | 154 web_contents()->GetController().GetLastCommittedEntry(); |
| 155 if (!entry) | 155 if (!entry) |
| 156 return; | 156 return; |
| 157 | 157 |
| 158 favicon_urls_ = candidates; | 158 favicon_urls_ = candidates; |
| 159 OnUpdateFaviconURL(entry->GetURL(), | 159 OnUpdateCandidates(entry->GetURL(), |
| 160 FaviconURLsFromContentFaviconURLs(candidates)); | 160 FaviconURLsFromContentFaviconURLs(candidates)); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ContentFaviconDriver::DidStartNavigation( | 163 void ContentFaviconDriver::DidStartNavigation( |
| 164 content::NavigationHandle* navigation_handle) { | 164 content::NavigationHandle* navigation_handle) { |
| 165 if (!navigation_handle->IsInMainFrame()) | 165 if (!navigation_handle->IsInMainFrame()) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 content::ReloadType reload_type = navigation_handle->GetReloadType(); | 168 content::ReloadType reload_type = navigation_handle->GetReloadType(); |
| 169 if (reload_type == content::ReloadType::NONE || IsOffTheRecord()) | 169 if (reload_type == content::ReloadType::NONE || IsOffTheRecord()) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 194 // redownloaded. | 194 // redownloaded. |
| 195 GURL url = navigation_handle->GetURL(); | 195 GURL url = navigation_handle->GetURL(); |
| 196 if (url != bypass_cache_page_url_) | 196 if (url != bypass_cache_page_url_) |
| 197 bypass_cache_page_url_ = GURL(); | 197 bypass_cache_page_url_ = GURL(); |
| 198 | 198 |
| 199 // Get the favicon, either from history or request it from the net. | 199 // Get the favicon, either from history or request it from the net. |
| 200 FetchFavicon(url); | 200 FetchFavicon(url); |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace favicon | 203 } // namespace favicon |
| OLD | NEW |