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/core/favicon_driver_impl.h" | 5 #include "components/favicon/core/favicon_driver_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, | 90 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, |
91 bool force_reload) { | 91 bool force_reload) { |
92 if (favicon_service_) { | 92 if (favicon_service_) { |
93 favicon_service_->SetFaviconOutOfDateForPage(url); | 93 favicon_service_->SetFaviconOutOfDateForPage(url); |
94 if (force_reload) | 94 if (force_reload) |
95 favicon_service_->ClearUnableToDownloadFavicons(); | 95 favicon_service_->ClearUnableToDownloadFavicons(); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 void FaviconDriverImpl::OnUpdateFaviconURL( | 99 void FaviconDriverImpl::OnUpdateCandidates( |
100 const GURL& page_url, | 100 const GURL& page_url, |
101 const std::vector<FaviconURL>& candidates) { | 101 const std::vector<FaviconURL>& candidates, |
102 DCHECK(!candidates.empty()); | 102 const base::Optional<GURL>& manifest_url) { |
103 RecordCandidateMetrics(candidates); | 103 RecordCandidateMetrics(candidates); |
104 for (const std::unique_ptr<FaviconHandler>& handler : handlers_) | 104 for (const std::unique_ptr<FaviconHandler>& handler : handlers_) { |
105 handler->OnUpdateFaviconURL(page_url, candidates); | 105 handler->OnUpdateCandidates(page_url, candidates, |
| 106 handler->icon_types() & favicon_base::FAVICON |
| 107 ? manifest_url |
| 108 : base::nullopt); |
| 109 } |
106 } | 110 } |
107 | 111 |
108 } // namespace favicon | 112 } // namespace favicon |
OLD | NEW |