OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CORE_FAVICON_DRIVER_H_ | 5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ |
6 #define COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ | 6 #define COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 virtual bool IsOffTheRecord() = 0; | 55 virtual bool IsOffTheRecord() = 0; |
56 | 56 |
57 // Returns whether |url| is bookmarked. | 57 // Returns whether |url| is bookmarked. |
58 virtual bool IsBookmarked(const GURL& url) = 0; | 58 virtual bool IsBookmarked(const GURL& url) = 0; |
59 | 59 |
60 // Returns the URL of the current page, if any. Returns an invalid URL | 60 // Returns the URL of the current page, if any. Returns an invalid URL |
61 // otherwise. | 61 // otherwise. |
62 virtual GURL GetActiveURL() = 0; | 62 virtual GURL GetActiveURL() = 0; |
63 | 63 |
64 // Returns whether the page's favicon is valid (returns false if the default | 64 // Returns whether the page's favicon is valid (returns false if the default |
65 // favicon is being used). Requires GetActiveURL() to be valid. | 65 // favicon is being used). |
66 virtual bool GetActiveFaviconValidity() = 0; | 66 virtual bool GetActiveFaviconValidity() = 0; |
67 | 67 |
68 // Sets whether the page's favicon is valid (if false, the default favicon is | 68 // Sets whether the page's favicon is valid (if false, the default favicon is |
69 // being used). | 69 // being used). |
70 virtual void SetActiveFaviconValidity(bool valid) = 0; | 70 virtual void SetActiveFaviconValidity(bool valid) = 0; |
71 | 71 |
72 // Returns the URL of the current page's favicon. Requires GetActiveURL() to | 72 // Returns the URL of the current page's favicon. |
73 // be valid. | |
74 virtual GURL GetActiveFaviconURL() = 0; | 73 virtual GURL GetActiveFaviconURL() = 0; |
75 | 74 |
76 // Sets the URL of the favicon's bitmap. | 75 // Sets the URL of the favicon's bitmap. |
77 virtual void SetActiveFaviconURL(const GURL& url) = 0; | 76 virtual void SetActiveFaviconURL(const GURL& url) = 0; |
78 | 77 |
79 // Sets the bitmap of the current page's favicon. | 78 // Sets the bitmap of the current page's favicon. |
80 virtual void SetActiveFaviconImage(const gfx::Image& image) = 0; | 79 virtual void SetActiveFaviconImage(const gfx::Image& image) = 0; |
81 | 80 |
81 // Returns whether any notifications should be sent when a favicon image is | |
82 // available. | |
83 virtual bool ShouldSendFaviconAvailableNotifications() = 0; | |
sky
2015/09/11 15:27:15
This feels awkward. Why not cancel the fetch?
pkotwicz
2015/09/11 17:39:58
It is awkward. In order to cancel the fetch we nee
sky
2015/09/11 19:53:21
I'm not familiar with the iOS code. Might rohitrao
| |
84 | |
82 // Notifies the driver a favicon image is available. |image| is not | 85 // Notifies the driver a favicon image is available. |image| is not |
83 // necessarily 16x16. |icon_url| is the url the image is from. If | 86 // necessarily 16x16. |icon_url| is the url the image is from. If |
84 // |is_active_favicon| is true the image corresponds to the favicon | 87 // |is_active_favicon| is true the image corresponds to the favicon |
85 // (possibly empty) of the page. | 88 // (possibly empty) of the page. |
86 virtual void OnFaviconAvailable(const gfx::Image& image, | 89 virtual void OnFaviconAvailable(const gfx::Image& image, |
87 const GURL& icon_url, | 90 const GURL& icon_url, |
88 bool is_active_favicon) = 0; | 91 bool is_active_favicon) = 0; |
89 | 92 |
90 // Returns whether the driver is waiting for a download to complete or for | 93 // Returns whether the driver is waiting for a download to complete or for |
91 // data from the FaviconService. Reserved for testing. | 94 // data from the FaviconService. Reserved for testing. |
(...skipping 14 matching lines...) Expand all Loading... | |
106 | 109 |
107 private: | 110 private: |
108 base::ObserverList<FaviconDriverObserver> observer_list_; | 111 base::ObserverList<FaviconDriverObserver> observer_list_; |
109 | 112 |
110 DISALLOW_COPY_AND_ASSIGN(FaviconDriver); | 113 DISALLOW_COPY_AND_ASSIGN(FaviconDriver); |
111 }; | 114 }; |
112 | 115 |
113 } // namespace favicon | 116 } // namespace favicon |
114 | 117 |
115 #endif // COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ | 118 #endif // COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ |
OLD | NEW |