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 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_IMPL_H_ | 5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_IMPL_H_ |
6 #define COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_IMPL_H_ | 6 #define COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/optional.h" |
12 #include "components/favicon/core/favicon_driver.h" | 13 #include "components/favicon/core/favicon_driver.h" |
13 #include "components/favicon/core/favicon_handler.h" | 14 #include "components/favicon/core/favicon_handler.h" |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 namespace bookmarks { | 17 namespace bookmarks { |
17 class BookmarkModel; | 18 class BookmarkModel; |
18 } | 19 } |
19 | 20 |
20 | 21 |
21 namespace history { | 22 namespace history { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 bookmarks::BookmarkModel* bookmark_model); | 54 bookmarks::BookmarkModel* bookmark_model); |
54 ~FaviconDriverImpl() override; | 55 ~FaviconDriverImpl() override; |
55 | 56 |
56 // Informs FaviconService that the favicon for |url| is out of date. If | 57 // Informs FaviconService that the favicon for |url| is out of date. If |
57 // |force_reload| is true, then discard information about favicon download | 58 // |force_reload| is true, then discard information about favicon download |
58 // failures. | 59 // failures. |
59 void SetFaviconOutOfDateForPage(const GURL& url, bool force_reload); | 60 void SetFaviconOutOfDateForPage(const GURL& url, bool force_reload); |
60 | 61 |
61 // Broadcasts new favicon URL candidates to FaviconHandlers. | 62 // Broadcasts new favicon URL candidates to FaviconHandlers. |
62 void OnUpdateCandidates(const GURL& page_url, | 63 void OnUpdateCandidates(const GURL& page_url, |
63 const std::vector<FaviconURL>& candidates); | 64 const std::vector<FaviconURL>& candidates, |
| 65 const base::Optional<GURL>& manifest_url); |
64 | 66 |
65 protected: | 67 protected: |
66 history::HistoryService* history_service() { return history_service_; } | 68 history::HistoryService* history_service() { return history_service_; } |
67 | 69 |
68 FaviconService* favicon_service() { return favicon_service_; } | 70 FaviconService* favicon_service() { return favicon_service_; } |
69 | 71 |
70 private: | 72 private: |
71 // KeyedServices used by FaviconDriverImpl. They may be null during testing, | 73 // KeyedServices used by FaviconDriverImpl. They may be null during testing, |
72 // but if they are defined, they must outlive the FaviconDriverImpl. | 74 // but if they are defined, they must outlive the FaviconDriverImpl. |
73 FaviconService* favicon_service_; | 75 FaviconService* favicon_service_; |
74 history::HistoryService* history_service_; | 76 history::HistoryService* history_service_; |
75 bookmarks::BookmarkModel* bookmark_model_; | 77 bookmarks::BookmarkModel* bookmark_model_; |
76 | 78 |
77 // FaviconHandlers used to download the different kind of favicons. | 79 // FaviconHandlers used to download the different kind of favicons. |
78 std::vector<std::unique_ptr<FaviconHandler>> handlers_; | 80 std::vector<std::unique_ptr<FaviconHandler>> handlers_; |
79 | 81 |
80 DISALLOW_COPY_AND_ASSIGN(FaviconDriverImpl); | 82 DISALLOW_COPY_AND_ASSIGN(FaviconDriverImpl); |
81 }; | 83 }; |
82 | 84 |
83 } // namespace favicon | 85 } // namespace favicon |
84 | 86 |
85 #endif // COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_IMPL_H_ | 87 #endif // COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_IMPL_H_ |
OLD | NEW |