| 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/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "components/bookmarks/browser/bookmark_model.h" | 10 #include "components/bookmarks/browser/bookmark_model.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool FaviconDriverImpl::HasPendingTasksForTest() { | 56 bool FaviconDriverImpl::HasPendingTasksForTest() { |
| 57 if (favicon_handler_->HasPendingTasksForTest()) | 57 if (favicon_handler_->HasPendingTasksForTest()) |
| 58 return true; | 58 return true; |
| 59 if (touch_icon_handler_ && touch_icon_handler_->HasPendingTasksForTest()) | 59 if (touch_icon_handler_ && touch_icon_handler_->HasPendingTasksForTest()) |
| 60 return true; | 60 return true; |
| 61 return false; | 61 return false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool FaviconDriverImpl::WasUnableToDownloadFavicon(const GURL& url) { | |
| 65 return favicon_service_ && favicon_service_->WasUnableToDownloadFavicon(url); | |
| 66 } | |
| 67 | |
| 68 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, | 64 void FaviconDriverImpl::SetFaviconOutOfDateForPage(const GURL& url, |
| 69 bool force_reload) { | 65 bool force_reload) { |
| 70 if (favicon_service_) { | 66 if (favicon_service_) { |
| 71 favicon_service_->SetFaviconOutOfDateForPage(url); | 67 favicon_service_->SetFaviconOutOfDateForPage(url); |
| 72 if (force_reload) | 68 if (force_reload) |
| 73 favicon_service_->ClearUnableToDownloadFavicons(); | 69 favicon_service_->ClearUnableToDownloadFavicons(); |
| 74 } | 70 } |
| 75 } | 71 } |
| 76 | 72 |
| 77 void FaviconDriverImpl::OnUpdateFaviconURL( | 73 void FaviconDriverImpl::OnUpdateFaviconURL( |
| 78 const GURL& page_url, | 74 const GURL& page_url, |
| 79 const std::vector<FaviconURL>& candidates) { | 75 const std::vector<FaviconURL>& candidates) { |
| 80 DCHECK(!candidates.empty()); | 76 DCHECK(!candidates.empty()); |
| 81 favicon_handler_->OnUpdateFaviconURL(page_url, candidates); | 77 favicon_handler_->OnUpdateFaviconURL(page_url, candidates); |
| 82 if (touch_icon_handler_.get()) | 78 if (touch_icon_handler_.get()) |
| 83 touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates); | 79 touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates); |
| 84 } | 80 } |
| 85 | 81 |
| 86 } // namespace favicon | 82 } // namespace favicon |
| OLD | NEW |