Chromium Code Reviews| Index: components/favicon/content/content_favicon_driver.h |
| diff --git a/components/favicon/content/content_favicon_driver.h b/components/favicon/content/content_favicon_driver.h |
| index 54a68884d81a94369bf52e3f7905004029f6fa29..4231372695f41c769eca8990edd395172f449a4f 100644 |
| --- a/components/favicon/content/content_favicon_driver.h |
| +++ b/components/favicon/content/content_favicon_driver.h |
| @@ -6,6 +6,7 @@ |
| #define COMPONENTS_FAVICON_CONTENT_CONTENT_FAVICON_DRIVER_H_ |
| #include "base/macros.h" |
| +#include "base/optional.h" |
| #include "components/favicon/core/favicon_driver_impl.h" |
| #include "content/public/browser/reload_type.h" |
| #include "content/public/browser/web_contents_observer.h" |
| @@ -36,7 +37,7 @@ class ContentFaviconDriver |
| // Returns the current tab's favicon URLs. If this is empty, |
| // DidUpdateFaviconURL has not yet been called for the current navigation. |
| - const std::vector<content::FaviconURL>& favicon_urls() const { |
| + const base::Optional<std::vector<content::FaviconURL>>& favicon_urls() const { |
| return favicon_urls_; |
| } |
| @@ -62,6 +63,8 @@ class ContentFaviconDriver |
| int DownloadImage(const GURL& url, |
| int max_image_size, |
| ImageDownloadCallback callback) override; |
| + void DownloadManifest(const GURL& url, |
| + ManifestDownloadCallback callback) override; |
| bool IsOffTheRecord() override; |
| void OnFaviconUpdated(const GURL& page_url, |
| FaviconDriverObserver::NotificationIconType icon_type, |
| @@ -72,13 +75,21 @@ class ContentFaviconDriver |
| // content::WebContentsObserver implementation. |
| void DidUpdateFaviconURL( |
| const std::vector<content::FaviconURL>& candidates) override; |
| + void DidUpdateWebManifestURL( |
| + const base::Optional<GURL>& manifest_url) override; |
| void DidStartNavigation( |
| content::NavigationHandle* navigation_handle) override; |
| void DidFinishNavigation( |
| content::NavigationHandle* navigation_handle) override; |
| GURL bypass_cache_page_url_; |
| - std::vector<content::FaviconURL> favicon_urls_; |
| + // nullopt until the actual list is reported via DidUpdateFaviconURL(). |
| + base::Optional<std::vector<content::FaviconURL>> favicon_urls_; |
|
pkotwicz
2017/05/11 06:12:57
Can this be a normal std::vector? I think that we
mastiz
2017/05/11 08:45:18
The condition in content_favicon_driver.cc:199 nee
pkotwicz
2017/05/12 06:13:28
I see. Thank you for pointing this out
|
| + // Whether DidUpdateManifestURL() was called at least once after |
| + // DidStartNavigation(). Note that this doesn't imply an actual manifest URL, |
| + // i.e. the page might not have a web manifest. |
| + bool received_manifest_url_; |
| + base::Optional<GURL> manifest_url_; |
|
pkotwicz
2017/05/11 06:12:57
Can this just be a GURL? I think that we treat an
mastiz
2017/05/11 08:45:18
This is feasible, but note that WebContents' API e
pkotwicz
2017/05/12 06:13:28
In my opinion being consistent with the WebContent
mastiz
2017/05/12 13:31:32
Done.
|
| DISALLOW_COPY_AND_ASSIGN(ContentFaviconDriver); |
| }; |