| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 manifest_url_); | 203 manifest_url_); |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 void ContentFaviconDriver::DidStartNavigation( | 207 void ContentFaviconDriver::DidStartNavigation( |
| 208 content::NavigationHandle* navigation_handle) { | 208 content::NavigationHandle* navigation_handle) { |
| 209 if (!navigation_handle->IsInMainFrame()) | 209 if (!navigation_handle->IsInMainFrame()) |
| 210 return; | 210 return; |
| 211 | 211 |
| 212 favicon_urls_.reset(); | 212 favicon_urls_.reset(); |
| 213 manifest_url_ = GURL(); | 213 |
| 214 if (!navigation_handle->IsSameDocument()) |
| 215 manifest_url_ = GURL(); |
| 214 | 216 |
| 215 content::ReloadType reload_type = navigation_handle->GetReloadType(); | 217 content::ReloadType reload_type = navigation_handle->GetReloadType(); |
| 216 if (reload_type == content::ReloadType::NONE || IsOffTheRecord()) | 218 if (reload_type == content::ReloadType::NONE || IsOffTheRecord()) |
| 217 return; | 219 return; |
| 218 | 220 |
| 219 bypass_cache_page_url_ = navigation_handle->GetURL(); | 221 bypass_cache_page_url_ = navigation_handle->GetURL(); |
| 220 SetFaviconOutOfDateForPage( | 222 SetFaviconOutOfDateForPage( |
| 221 navigation_handle->GetURL(), | 223 navigation_handle->GetURL(), |
| 222 reload_type == content::ReloadType::BYPASSING_CACHE); | 224 reload_type == content::ReloadType::BYPASSING_CACHE); |
| 223 } | 225 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 239 // redownloaded. | 241 // redownloaded. |
| 240 GURL url = navigation_handle->GetURL(); | 242 GURL url = navigation_handle->GetURL(); |
| 241 if (url != bypass_cache_page_url_) | 243 if (url != bypass_cache_page_url_) |
| 242 bypass_cache_page_url_ = GURL(); | 244 bypass_cache_page_url_ = GURL(); |
| 243 | 245 |
| 244 // Get the favicon, either from history or request it from the net. | 246 // Get the favicon, either from history or request it from the net. |
| 245 FetchFavicon(url); | 247 FetchFavicon(url); |
| 246 } | 248 } |
| 247 | 249 |
| 248 } // namespace favicon | 250 } // namespace favicon |
| OLD | NEW |