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_IOS_WEB_FAVICON_DRIVER_H_ | 5 #ifndef COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_ |
6 #define COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_ | 6 #define COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/favicon/core/favicon_driver_impl.h" | 9 #include "components/favicon/core/favicon_driver_impl.h" |
10 #include "ios/web/public/web_state/web_state_observer.h" | 10 #include "ios/web/public/web_state/web_state_observer.h" |
11 #include "ios/web/public/web_state/web_state_user_data.h" | 11 #include "ios/web/public/web_state/web_state_user_data.h" |
12 | 12 |
13 namespace web { | 13 namespace web { |
14 class WebState; | 14 class WebState; |
15 } | 15 } |
16 | 16 |
| 17 class DistillerFaviconDriver; |
| 18 |
17 namespace favicon { | 19 namespace favicon { |
18 | 20 |
19 // WebFaviconDriver is an implementation of FaviconDriver that listen to | 21 // WebFaviconDriver is an implementation of FaviconDriver that listen to |
20 // WebState events to start download of favicons and to get informed when the | 22 // WebState events to start download of favicons and to get informed when the |
21 // favicon download has completed. | 23 // favicon download has completed. |
22 class WebFaviconDriver : public web::WebStateObserver, | 24 class WebFaviconDriver : public web::WebStateObserver, |
23 public web::WebStateUserData<WebFaviconDriver>, | 25 public web::WebStateUserData<WebFaviconDriver>, |
24 public FaviconDriverImpl { | 26 public FaviconDriverImpl { |
| 27 friend class ::DistillerFaviconDriver; |
| 28 |
25 public: | 29 public: |
26 static void CreateForWebState(web::WebState* web_state, | 30 static void CreateForWebState(web::WebState* web_state, |
27 FaviconService* favicon_service, | 31 FaviconService* favicon_service, |
28 history::HistoryService* history_service, | 32 history::HistoryService* history_service, |
29 bookmarks::BookmarkModel* bookmark_model); | 33 bookmarks::BookmarkModel* bookmark_model); |
30 | 34 |
31 // FaviconDriver implementation. | 35 // FaviconDriver implementation. |
32 void FetchFavicon(const GURL& url) override; | 36 void FetchFavicon(const GURL& url) override; |
33 gfx::Image GetFavicon() const override; | 37 gfx::Image GetFavicon() const override; |
34 bool FaviconIsValid() const override; | 38 bool FaviconIsValid() const override; |
(...skipping 22 matching lines...) Expand all Loading... |
57 | 61 |
58 // The URL passed to FetchFavicon(). | 62 // The URL passed to FetchFavicon(). |
59 GURL fetch_favicon_url_; | 63 GURL fetch_favicon_url_; |
60 | 64 |
61 DISALLOW_COPY_AND_ASSIGN(WebFaviconDriver); | 65 DISALLOW_COPY_AND_ASSIGN(WebFaviconDriver); |
62 }; | 66 }; |
63 | 67 |
64 } // namespace favicon | 68 } // namespace favicon |
65 | 69 |
66 #endif // COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_ | 70 #endif // COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_ |
OLD | NEW |