| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/favicon_downloader.h" | 5 #include "chrome/browser/extensions/favicon_downloader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/favicon/favicon_tab_helper.h" | 8 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/common/favicon_url.h" | 10 #include "content/public/common/favicon_url.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void FaviconDownloader::DidNavigateMainFrame( | 105 void FaviconDownloader::DidNavigateMainFrame( |
| 106 const content::LoadCommittedDetails& details, | 106 const content::LoadCommittedDetails& details, |
| 107 const content::FrameNavigateParams& params) { | 107 const content::FrameNavigateParams& params) { |
| 108 // Clear all pending requests. | 108 // Clear all pending requests. |
| 109 in_progress_requests_.clear(); | 109 in_progress_requests_.clear(); |
| 110 favicon_map_.clear(); | 110 favicon_map_.clear(); |
| 111 callback_.Run(false, favicon_map_); | 111 callback_.Run(false, favicon_map_); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void FaviconDownloader::DidUpdateFaviconURL( | 114 void FaviconDownloader::DidUpdateFaviconURL( |
| 115 int32 page_id, | |
| 116 const std::vector<content::FaviconURL>& candidates) { | 115 const std::vector<content::FaviconURL>& candidates) { |
| 117 // Only consider the first candidates we are given. This prevents pages that | 116 // Only consider the first candidates we are given. This prevents pages that |
| 118 // change their favicon from spamming us. | 117 // change their favicon from spamming us. |
| 119 if (got_favicon_urls_) | 118 if (got_favicon_urls_) |
| 120 return; | 119 return; |
| 121 | 120 |
| 122 got_favicon_urls_ = true; | 121 got_favicon_urls_ = true; |
| 123 FetchIcons(candidates); | 122 FetchIcons(candidates); |
| 124 } | 123 } |
| OLD | NEW |