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 25 matching lines...) Expand all Loading... |
36 const std::vector<content::FaviconURL>& favicon_urls() const { | 36 const std::vector<content::FaviconURL>& favicon_urls() const { |
37 return favicon_urls_; | 37 return favicon_urls_; |
38 } | 38 } |
39 | 39 |
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 GURL GetFaviconURL() const override; |
46 bool FaviconIsValid() const override; | 47 bool FaviconIsValid() const override; |
47 int StartDownload(const GURL& url, int max_bitmap_size) override; | 48 int StartDownload(const GURL& url, int max_bitmap_size) override; |
48 bool IsOffTheRecord() override; | 49 bool IsOffTheRecord() override; |
49 GURL GetActiveURL() override; | 50 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 | 51 |
55 protected: | 52 protected: |
56 ContentFaviconDriver(content::WebContents* web_contents, | 53 ContentFaviconDriver(content::WebContents* web_contents, |
57 FaviconService* favicon_service, | 54 FaviconService* favicon_service, |
58 history::HistoryService* history_service, | 55 history::HistoryService* history_service, |
59 bookmarks::BookmarkModel* bookmark_model); | 56 bookmarks::BookmarkModel* bookmark_model); |
60 ~ContentFaviconDriver() override; | 57 ~ContentFaviconDriver() override; |
61 | 58 |
62 private: | 59 private: |
63 friend class content::WebContentsUserData<ContentFaviconDriver>; | 60 friend class content::WebContentsUserData<ContentFaviconDriver>; |
64 | 61 |
65 // FaviconDriver implementation. | 62 // FaviconDriver implementation. |
66 void NotifyFaviconUpdated(bool icon_url_changed) override; | 63 void OnFaviconUpdated( |
| 64 const GURL& page_url, |
| 65 FaviconDriverObserver::NotificationIconType icon_type, |
| 66 const GURL& icon_url, |
| 67 bool icon_url_changed, |
| 68 const gfx::Image& image) override; |
67 | 69 |
68 // content::WebContentsObserver implementation. | 70 // content::WebContentsObserver implementation. |
69 void DidUpdateFaviconURL( | 71 void DidUpdateFaviconURL( |
70 const std::vector<content::FaviconURL>& candidates) override; | 72 const std::vector<content::FaviconURL>& candidates) override; |
71 void DidStartNavigationToPendingEntry( | 73 void DidStartNavigationToPendingEntry( |
72 const GURL& url, | 74 const GURL& url, |
73 content::NavigationController::ReloadType reload_type) override; | 75 content::NavigationController::ReloadType reload_type) override; |
74 void DidNavigateMainFrame( | 76 void DidNavigateMainFrame( |
75 const content::LoadCommittedDetails& details, | 77 const content::LoadCommittedDetails& details, |
76 const content::FrameNavigateParams& params) override; | 78 const content::FrameNavigateParams& params) override; |
77 | 79 |
78 // Returns the active navigation entry's favicon. | |
79 content::FaviconStatus& GetFaviconStatus(); | |
80 | |
81 GURL bypass_cache_page_url_; | 80 GURL bypass_cache_page_url_; |
82 std::vector<content::FaviconURL> favicon_urls_; | 81 std::vector<content::FaviconURL> favicon_urls_; |
83 | 82 |
84 DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); | 83 DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); |
85 }; | 84 }; |
86 | 85 |
87 } // namespace favicon | 86 } // namespace favicon |
88 | 87 |
89 #endif // COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ | 88 #endif // COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ |
OLD | NEW |