Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: components/favicon/ios/web_favicon_driver.h

Issue 1407353012: Refactor FaviconDriver::OnFaviconAvailable() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@initial_simplify
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/favicon/core/favicon_driver_impl.h" 8 #include "components/favicon/core/favicon_driver_impl.h"
9 #include "ios/web/public/web_state/web_state_observer.h" 9 #include "ios/web/public/web_state/web_state_observer.h"
10 #include "ios/web/public/web_state/web_state_user_data.h" 10 #include "ios/web/public/web_state/web_state_user_data.h"
(...skipping 13 matching lines...) Expand all
24 public FaviconDriverImpl { 24 public FaviconDriverImpl {
25 public: 25 public:
26 static void CreateForWebState(web::WebState* web_state, 26 static void CreateForWebState(web::WebState* web_state,
27 FaviconService* favicon_service, 27 FaviconService* favicon_service,
28 history::HistoryService* history_service, 28 history::HistoryService* history_service,
29 bookmarks::BookmarkModel* bookmark_model); 29 bookmarks::BookmarkModel* bookmark_model);
30 30
31 // FaviconDriver implementation. 31 // FaviconDriver implementation.
32 void FetchFavicon(const GURL& url) override; 32 void FetchFavicon(const GURL& url) override;
33 gfx::Image GetFavicon() const override; 33 gfx::Image GetFavicon() const override;
34 GURL GetFaviconURL() const override;
34 bool FaviconIsValid() const override; 35 bool FaviconIsValid() const override;
35 int StartDownload(const GURL& url, int max_bitmap_size) override; 36 int StartDownload(const GURL& url, int max_bitmap_size) override;
36 bool IsOffTheRecord() override; 37 bool IsOffTheRecord() override;
37 GURL GetActiveURL() override; 38 GURL GetActiveURL() override;
38 void SetActiveFaviconValidity(bool valid) override; 39 void OnFaviconUpdated(
39 GURL GetActiveFaviconURL() override; 40 const GURL& page_url,
40 void SetActiveFaviconURL(const GURL& url) override; 41 FaviconDriverObserver::NotificationIconType notification_icon_type,
41 void SetActiveFaviconImage(const gfx::Image& image) override; 42 const GURL& icon_url,
43 bool icon_url_changed,
44 const gfx::Image& image) override;
42 45
43 private: 46 private:
44 friend class web::WebStateUserData<WebFaviconDriver>; 47 friend class web::WebStateUserData<WebFaviconDriver>;
45 48
46 WebFaviconDriver(web::WebState* web_state, 49 WebFaviconDriver(web::WebState* web_state,
47 FaviconService* favicon_service, 50 FaviconService* favicon_service,
48 history::HistoryService* history_service, 51 history::HistoryService* history_service,
49 bookmarks::BookmarkModel* bookmark_model); 52 bookmarks::BookmarkModel* bookmark_model);
50 ~WebFaviconDriver() override; 53 ~WebFaviconDriver() override;
51 54
52 // web::WebStateObserver implementation. 55 // web::WebStateObserver implementation.
53 void FaviconUrlUpdated( 56 void FaviconUrlUpdated(
54 const std::vector<web::FaviconURL>& candidates) override; 57 const std::vector<web::FaviconURL>& candidates) override;
55 58
56 // Returns the active navigation entry's favicon.
57 web::FaviconStatus& GetFaviconStatus();
58
59 // The URL passed to FetchFavicon(). 59 // The URL passed to FetchFavicon().
60 GURL fetch_favicon_url_; 60 GURL fetch_favicon_url_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(WebFaviconDriver); 62 DISALLOW_COPY_AND_ASSIGN(WebFaviconDriver);
63 }; 63 };
64 64
65 } // namespace favicon 65 } // namespace favicon
66 66
67 #endif // COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_ 67 #endif // COMPONENTS_FAVICON_IOS_WEB_FAVICON_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698