From 70a04802728cbdc0c3da3c5a43fd2aa6feaf1ca8 Mon Sep 17 00:00:00 2001 From: sdefresne Date: Thu, 9 Apr 2015 07:00:17 -0700 Subject: Componentize FaviconTabHelper Split FaviconTabHelper into three classes depending on what can be shared with iOS (FaviconDriverImpl), what only depends on //content (ContentFaviconDriver) and what depends on //chrome (FaviconTabHelper). FaviconTabHelper still exists to provide an easier factory (as ContentFaviconDriver cannot access KeyedService factories defined in //chrome) as FaviconTabHelper::CreateForWebContents() is called from multiple locations in //chrome code and to provide an implementation for FaviconTabHelper::ShouldDisplayFavicon (this method will be turned into a free function in a followup CL as it only depends on WebContents public interface, not on ContentFaviconDriver). Introduce WebFaviconDriver, an iOS implementation of FaviconDriver that uses FaviconDriverImpl to share as much code as possible with the ContentFaviconDriver. BUG=370877, 472117 Review URL: https://codereview.chromium.org/1064823002 Cr-Commit-Position: refs/heads/master@{#324430} --- chrome/browser/favicon/favicon_tab_helper_browsertest.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'chrome/browser/favicon/favicon_tab_helper_browsertest.cc') diff --git a/chrome/browser/favicon/favicon_tab_helper_browsertest.cc b/chrome/browser/favicon/favicon_tab_helper_browsertest.cc index 8722b5b..567d825 100644 --- a/chrome/browser/favicon/favicon_tab_helper_browsertest.cc +++ b/chrome/browser/favicon/favicon_tab_helper_browsertest.cc @@ -187,11 +187,8 @@ class FaviconTabHelperTest : public InProcessBrowserTest, // FaviconTabHelperPendingTaskChecker: bool HasPendingTasks() override { - favicon::FaviconHandler* favicon_handler = - FaviconTabHelper::FromWebContents(web_contents()) - ->favicon_handler_.get(); - return !favicon_handler->download_requests_.empty() || - favicon_handler->cancelable_task_tracker_.HasTrackedTasks(); + return FaviconTabHelper::FromWebContents(web_contents()) + ->HasPendingTasksForTest(); } private: -- cgit v1.1