| 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 "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 "content/public/browser/reload_type.h" | 10 #include "content/public/browser/reload_type.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 return favicon_urls_; | 38 return favicon_urls_; |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Saves the favicon for the last committed navigation entry to the thumbnail | 41 // Saves the favicon for the last committed navigation entry to the thumbnail |
| 42 // database. | 42 // database. |
| 43 void SaveFavicon(); | 43 void SaveFavicon(); |
| 44 | 44 |
| 45 // FaviconDriver implementation. | 45 // FaviconDriver implementation. |
| 46 gfx::Image GetFavicon() const override; | 46 gfx::Image GetFavicon() const override; |
| 47 bool FaviconIsValid() const override; | 47 bool FaviconIsValid() const override; |
| 48 int StartDownload(const GURL& url, int max_bitmap_size) override; | |
| 49 bool IsOffTheRecord() override; | |
| 50 GURL GetActiveURL() override; | 48 GURL GetActiveURL() override; |
| 51 | 49 |
| 52 protected: | 50 protected: |
| 53 ContentFaviconDriver(content::WebContents* web_contents, | 51 ContentFaviconDriver(content::WebContents* web_contents, |
| 54 FaviconService* favicon_service, | 52 FaviconService* favicon_service, |
| 55 history::HistoryService* history_service, | 53 history::HistoryService* history_service, |
| 56 bookmarks::BookmarkModel* bookmark_model); | 54 bookmarks::BookmarkModel* bookmark_model); |
| 57 ~ContentFaviconDriver() override; | 55 ~ContentFaviconDriver() override; |
| 58 | 56 |
| 59 private: | 57 private: |
| 60 friend class content::WebContentsUserData<ContentFaviconDriver>; | 58 friend class content::WebContentsUserData<ContentFaviconDriver>; |
| 61 | 59 |
| 62 // FaviconDriver implementation. | 60 // FaviconHandler::Delegate implementation. |
| 63 void OnFaviconUpdated( | 61 int DownloadImage(const GURL& url, |
| 64 const GURL& page_url, | 62 int max_image_size, |
| 65 FaviconDriverObserver::NotificationIconType icon_type, | 63 ImageDownloadCallback callback) override; |
| 66 const GURL& icon_url, | 64 bool IsOffTheRecord() override; |
| 67 bool icon_url_changed, | 65 void OnFaviconUpdated(const GURL& page_url, |
| 68 const gfx::Image& image) override; | 66 FaviconDriverObserver::NotificationIconType icon_type, |
| 67 const GURL& icon_url, |
| 68 bool icon_url_changed, |
| 69 const gfx::Image& image) override; |
| 69 | 70 |
| 70 // content::WebContentsObserver implementation. | 71 // content::WebContentsObserver implementation. |
| 71 void DidUpdateFaviconURL( | 72 void DidUpdateFaviconURL( |
| 72 const std::vector<content::FaviconURL>& candidates) override; | 73 const std::vector<content::FaviconURL>& candidates) override; |
| 73 void DidStartNavigation( | 74 void DidStartNavigation( |
| 74 content::NavigationHandle* navigation_handle) override; | 75 content::NavigationHandle* navigation_handle) override; |
| 75 void DidFinishNavigation( | 76 void DidFinishNavigation( |
| 76 content::NavigationHandle* navigation_handle) override; | 77 content::NavigationHandle* navigation_handle) override; |
| 77 | 78 |
| 78 GURL bypass_cache_page_url_; | 79 GURL bypass_cache_page_url_; |
| 79 std::vector<content::FaviconURL> favicon_urls_; | 80 std::vector<content::FaviconURL> favicon_urls_; |
| 80 | 81 |
| 81 DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); | 82 DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace favicon | 85 } // namespace favicon |
| 85 | 86 |
| 86 #endif // COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ | 87 #endif // COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ |
| OLD | NEW |