Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: components/favicon/core/favicon_driver_impl.cc

Issue 2728893004: Move WasUnableToDownload logic to FaviconHandler (Closed)
Patch Set: Reverted accidental changes. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 bool FaviconDriverImpl::HasPendingTasksForTest() { 78 bool FaviconDriverImpl::HasPendingTasksForTest() {
79 if (favicon_handler_->HasPendingTasksForTest()) 79 if (favicon_handler_->HasPendingTasksForTest())
80 return true; 80 return true;
81 if (touch_icon_handler_ && touch_icon_handler_->HasPendingTasksForTest()) 81 if (touch_icon_handler_ && touch_icon_handler_->HasPendingTasksForTest())
82 return true; 82 return true;
83 return false; 83 return false;
84 } 84 }
85 85
86 bool FaviconDriverImpl::WasUnableToDownloadFavicon(const GURL& url) {
87 return favicon_service_ && favicon_service_->WasUnableToDownloadFavicon(url);
88 }
89
90 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, 86 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url,
91 bool force_reload) { 87 bool force_reload) {
92 if (favicon_service_) { 88 if (favicon_service_) {
93 favicon_service_->SetFaviconOutOfDateForPage(url); 89 favicon_service_->SetFaviconOutOfDateForPage(url);
94 if (force_reload) 90 if (force_reload)
95 favicon_service_->ClearUnableToDownloadFavicons(); 91 favicon_service_->ClearUnableToDownloadFavicons();
96 } 92 }
97 } 93 }
98 94
99 void FaviconDriverImpl::OnUpdateFaviconURL( 95 void FaviconDriverImpl::OnUpdateFaviconURL(
100 const GURL& page_url, 96 const GURL& page_url,
101 const std::vector<FaviconURL>& candidates) { 97 const std::vector<FaviconURL>& candidates) {
102 DCHECK(!candidates.empty()); 98 DCHECK(!candidates.empty());
103 RecordCandidateMetrics(candidates); 99 RecordCandidateMetrics(candidates);
104 favicon_handler_->OnUpdateFaviconURL(page_url, candidates); 100 favicon_handler_->OnUpdateFaviconURL(page_url, candidates);
105 if (touch_icon_handler_.get()) 101 if (touch_icon_handler_.get())
106 touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates); 102 touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates);
107 } 103 }
108 104
109 } // namespace favicon 105 } // namespace favicon
OLDNEW
« no previous file with comments | « components/favicon/core/favicon_driver_impl.h ('k') | components/favicon/core/favicon_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698