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_CONTENT_CONTENT_FAVICON_DRIVER_H_ | 5 #ifndef COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ |
6 #define COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ | 6 #define COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ |
7 | 7 |
8 #include "components/favicon/core/favicon_driver_impl.h" | 8 #include "components/favicon/core/favicon_driver_impl.h" |
9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
10 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Saves the favicon for the last committed navigation entry to the thumbnail | 40 // Saves the favicon for the last committed navigation entry to the thumbnail |
41 // database. | 41 // database. |
42 void SaveFavicon(); | 42 void SaveFavicon(); |
43 | 43 |
44 // FaviconDriver implementation. | 44 // FaviconDriver implementation. |
45 gfx::Image GetFavicon() const override; | 45 gfx::Image GetFavicon() const override; |
46 bool FaviconIsValid() const override; | 46 bool FaviconIsValid() const override; |
47 int StartDownload(const GURL& url, int max_bitmap_size) override; | 47 int StartDownload(const GURL& url, int max_bitmap_size) override; |
48 bool IsOffTheRecord() override; | 48 bool IsOffTheRecord() override; |
49 GURL GetActiveURL() override; | 49 GURL GetActiveURL() override; |
50 void SetActiveFaviconValidity(bool valid) override; | |
51 GURL GetActiveFaviconURL() override; | |
52 void SetActiveFaviconURL(const GURL& url) override; | |
53 void SetActiveFaviconImage(const gfx::Image& image) override; | |
54 | 50 |
55 protected: | 51 protected: |
56 ContentFaviconDriver(content::WebContents* web_contents, | 52 ContentFaviconDriver(content::WebContents* web_contents, |
57 FaviconService* favicon_service, | 53 FaviconService* favicon_service, |
58 history::HistoryService* history_service, | 54 history::HistoryService* history_service, |
59 bookmarks::BookmarkModel* bookmark_model); | 55 bookmarks::BookmarkModel* bookmark_model); |
60 ~ContentFaviconDriver() override; | 56 ~ContentFaviconDriver() override; |
61 | 57 |
62 private: | 58 private: |
63 friend class content::WebContentsUserData<ContentFaviconDriver>; | 59 friend class content::WebContentsUserData<ContentFaviconDriver>; |
64 | 60 |
65 // FaviconDriver implementation. | 61 // FaviconDriver implementation. |
66 void NotifyFaviconUpdated(bool icon_url_changed) override; | 62 void OnFaviconUpdated( |
| 63 const GURL& page_url, |
| 64 FaviconDriverObserver::NotificationIconType icon_type, |
| 65 const GURL& icon_url, |
| 66 bool icon_url_changed, |
| 67 const gfx::Image& image) override; |
67 | 68 |
68 // content::WebContentsObserver implementation. | 69 // content::WebContentsObserver implementation. |
69 void DidUpdateFaviconURL( | 70 void DidUpdateFaviconURL( |
70 const std::vector<content::FaviconURL>& candidates) override; | 71 const std::vector<content::FaviconURL>& candidates) override; |
71 void DidStartNavigationToPendingEntry( | 72 void DidStartNavigationToPendingEntry( |
72 const GURL& url, | 73 const GURL& url, |
73 content::NavigationController::ReloadType reload_type) override; | 74 content::NavigationController::ReloadType reload_type) override; |
74 void DidNavigateMainFrame( | 75 void DidNavigateMainFrame( |
75 const content::LoadCommittedDetails& details, | 76 const content::LoadCommittedDetails& details, |
76 const content::FrameNavigateParams& params) override; | 77 const content::FrameNavigateParams& params) override; |
77 | 78 |
78 // Returns the active navigation entry's favicon. | |
79 content::FaviconStatus& GetFaviconStatus(); | |
80 | |
81 GURL bypass_cache_page_url_; | 79 GURL bypass_cache_page_url_; |
82 std::vector<content::FaviconURL> favicon_urls_; | 80 std::vector<content::FaviconURL> favicon_urls_; |
83 | 81 |
84 DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); | 82 DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); |
85 }; | 83 }; |
86 | 84 |
87 } // namespace favicon | 85 } // namespace favicon |
88 | 86 |
89 #endif // COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ | 87 #endif // COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ |
OLD | NEW |