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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual bool IsOffTheRecord() = 0; | 58 virtual bool IsOffTheRecord() = 0; |
59 | 59 |
60 // Returns whether |url| is bookmarked. | 60 // Returns whether |url| is bookmarked. |
61 virtual bool IsBookmarked(const GURL& url) = 0; | 61 virtual bool IsBookmarked(const GURL& url) = 0; |
62 | 62 |
63 // Returns the URL of the current page, if any. Returns an invalid URL | 63 // Returns the URL of the current page, if any. Returns an invalid URL |
64 // otherwise. | 64 // otherwise. |
65 virtual GURL GetActiveURL() = 0; | 65 virtual GURL GetActiveURL() = 0; |
66 | 66 |
67 // Returns whether the page's favicon is valid (returns false if the default | 67 // Returns whether the page's favicon is valid (returns false if the default |
68 // favicon is being used). Requires GetActiveURL() to be valid. | 68 // favicon is being used). |
69 virtual bool GetActiveFaviconValidity() = 0; | 69 virtual bool GetActiveFaviconValidity() = 0; |
70 | 70 |
71 // Sets whether the page's favicon is valid (if false, the default favicon is | 71 // Sets whether the page's favicon is valid (if false, the default favicon is |
72 // being used). | 72 // being used). |
73 virtual void SetActiveFaviconValidity(bool valid) = 0; | 73 virtual void SetActiveFaviconValidity(bool valid) = 0; |
74 | 74 |
75 // Returns the URL of the current page's favicon. Requires GetActiveURL() to | 75 // Returns the URL of the current page's favicon. |
76 // be valid. | |
77 virtual GURL GetActiveFaviconURL() = 0; | 76 virtual GURL GetActiveFaviconURL() = 0; |
78 | 77 |
79 // Sets the URL of the favicon's bitmap. | 78 // Sets the URL of the favicon's bitmap. |
80 virtual void SetActiveFaviconURL(const GURL& url) = 0; | 79 virtual void SetActiveFaviconURL(const GURL& url) = 0; |
81 | 80 |
82 // Sets the bitmap of the current page's favicon. | 81 // Sets the bitmap of the current page's favicon. |
83 virtual void SetActiveFaviconImage(const gfx::Image& image) = 0; | 82 virtual void SetActiveFaviconImage(const gfx::Image& image) = 0; |
84 | 83 |
| 84 // Returns whether any notifications should be sent when a favicon image is |
| 85 // available. |
| 86 virtual bool ShouldSendFaviconAvailableNotifications() = 0; |
| 87 |
85 // Notifies the driver a favicon image is available. |image| is not | 88 // Notifies the driver a favicon image is available. |image| is not |
86 // necessarily 16x16. |icon_url| is the url the image is from. If | 89 // necessarily 16x16. |icon_url| is the url the image is from. If |
87 // |is_active_favicon| is true the image corresponds to the favicon | 90 // |is_active_favicon| is true the image corresponds to the favicon |
88 // (possibly empty) of the page. | 91 // (possibly empty) of the page. |
89 virtual void OnFaviconAvailable(const gfx::Image& image, | 92 virtual void OnFaviconAvailable(const gfx::Image& image, |
90 const GURL& icon_url, | 93 const GURL& icon_url, |
91 bool is_active_favicon) = 0; | 94 bool is_active_favicon) = 0; |
92 | 95 |
93 // Returns whether the driver is waiting for a download to complete or for | 96 // Returns whether the driver is waiting for a download to complete or for |
94 // data from the FaviconService. Reserved for testing. | 97 // data from the FaviconService. Reserved for testing. |
(...skipping 14 matching lines...) Expand all Loading... |
109 | 112 |
110 private: | 113 private: |
111 base::ObserverList<FaviconDriverObserver> observer_list_; | 114 base::ObserverList<FaviconDriverObserver> observer_list_; |
112 | 115 |
113 DISALLOW_COPY_AND_ASSIGN(FaviconDriver); | 116 DISALLOW_COPY_AND_ASSIGN(FaviconDriver); |
114 }; | 117 }; |
115 | 118 |
116 } // namespace favicon | 119 } // namespace favicon |
117 | 120 |
118 #endif // COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ | 121 #endif // COMPONENTS_FAVICON_CORE_FAVICON_DRIVER_H_ |
OLD | NEW |