| Index: components/favicon/content/content_favicon_driver.cc
|
| diff --git a/components/favicon/content/content_favicon_driver.cc b/components/favicon/content/content_favicon_driver.cc
|
| index cf9bba46bd0e8602c7267d70d0bfda0dce657bcf..1fd8d3a5f774c361c00e204a56ea31b5606fa151 100644
|
| --- a/components/favicon/content/content_favicon_driver.cc
|
| +++ b/components/favicon/content/content_favicon_driver.cc
|
| @@ -21,6 +21,15 @@
|
| DEFINE_WEB_CONTENTS_USER_DATA_KEY(favicon::ContentFaviconDriver);
|
|
|
| namespace favicon {
|
| +namespace {
|
| +
|
| +#if defined(OS_ANDROID)
|
| +const bool kEnableTouchIcon = true;
|
| +#else
|
| +const bool kEnableTouchIcon = false;
|
| +#endif
|
| +
|
| +} // namespace
|
|
|
| // static
|
| void ContentFaviconDriver::CreateForWebContents(
|
| @@ -74,34 +83,16 @@ gfx::Image ContentFaviconDriver::GetFavicon() const {
|
| return gfx::Image();
|
| }
|
|
|
| -bool ContentFaviconDriver::FaviconIsValid() const {
|
| - const content::NavigationController& controller =
|
| - web_contents()->GetController();
|
| - content::NavigationEntry* entry = controller.GetTransientEntry();
|
| - if (entry)
|
| - return entry->GetFavicon().valid;
|
| -
|
| - entry = controller.GetLastCommittedEntry();
|
| - if (entry)
|
| - return entry->GetFavicon().valid;
|
| -
|
| - return false;
|
| -}
|
| -
|
| -GURL ContentFaviconDriver::GetActiveURL() {
|
| - content::NavigationEntry* entry =
|
| - web_contents()->GetController().GetLastCommittedEntry();
|
| - return entry ? entry->GetURL() : GURL();
|
| -}
|
| -
|
| ContentFaviconDriver::ContentFaviconDriver(
|
| content::WebContents* web_contents,
|
| FaviconService* favicon_service,
|
| history::HistoryService* history_service,
|
| bookmarks::BookmarkModel* bookmark_model)
|
| : content::WebContentsObserver(web_contents),
|
| - FaviconDriverImpl(favicon_service, history_service, bookmark_model) {
|
| -}
|
| + FaviconDriverImpl(kEnableTouchIcon,
|
| + favicon_service,
|
| + history_service,
|
| + bookmark_model) {}
|
|
|
| ContentFaviconDriver::~ContentFaviconDriver() {
|
| }
|
| @@ -114,7 +105,11 @@ int ContentFaviconDriver::DownloadImage(const GURL& url,
|
| return 0;
|
| }
|
|
|
| - bool bypass_cache = (bypass_cache_page_url_ == GetActiveURL());
|
| + content::NavigationEntry* entry =
|
| + web_contents()->GetController().GetLastCommittedEntry();
|
| + const GURL active_url = entry ? entry->GetURL() : GURL();
|
| +
|
| + bool bypass_cache = (bypass_cache_page_url_ == active_url);
|
| bypass_cache_page_url_ = GURL();
|
|
|
| return web_contents()->DownloadImage(url, true, max_image_size, bypass_cache,
|
|
|