Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: ios/chrome/browser/tabs/tab_helper_util.mm

Issue 2774603002: Removes the IsReadingListEnabled flags (Closed)
Patch Set: fix tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #import "ios/chrome/browser/tabs/tab_helper_util.h" 5 #import "ios/chrome/browser/tabs/tab_helper_util.h"
6 6
7 #if !defined(__has_feature) || !__has_feature(objc_arc) 7 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support." 8 #error "This file requires ARC support."
9 #endif 9 #endif
10 10
11 #import "components/favicon/ios/web_favicon_driver.h" 11 #import "components/favicon/ios/web_favicon_driver.h"
12 #include "components/history/core/browser/top_sites.h" 12 #include "components/history/core/browser/top_sites.h"
13 #import "components/history/ios/browser/web_state_top_sites_observer.h" 13 #import "components/history/ios/browser/web_state_top_sites_observer.h"
14 #include "components/keyed_service/core/service_access_type.h" 14 #include "components/keyed_service/core/service_access_type.h"
15 #include "components/reading_list/core/reading_list_switches.h"
16 #import "components/signin/ios/browser/account_consistency_service.h" 15 #import "components/signin/ios/browser/account_consistency_service.h"
17 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" 16 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
18 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 17 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
19 #include "ios/chrome/browser/favicon/favicon_service_factory.h" 18 #include "ios/chrome/browser/favicon/favicon_service_factory.h"
20 #import "ios/chrome/browser/find_in_page/find_tab_helper.h" 19 #import "ios/chrome/browser/find_in_page/find_tab_helper.h"
21 #include "ios/chrome/browser/history/history_service_factory.h" 20 #include "ios/chrome/browser/history/history_service_factory.h"
22 #include "ios/chrome/browser/history/top_sites_factory.h" 21 #include "ios/chrome/browser/history/top_sites_factory.h"
23 #import "ios/chrome/browser/infobars/infobar_manager_impl.h" 22 #import "ios/chrome/browser/infobars/infobar_manager_impl.h"
24 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" 23 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
25 #import "ios/chrome/browser/reading_list/reading_list_web_state_observer.h" 24 #import "ios/chrome/browser/reading_list/reading_list_web_state_observer.h"
(...skipping 23 matching lines...) Expand all
49 48
50 NetworkActivityIndicatorTabHelper::CreateForWebState(web_state, tab.tabId); 49 NetworkActivityIndicatorTabHelper::CreateForWebState(web_state, tab.tabId);
51 IOSChromeSyncedTabDelegate::CreateForWebState(web_state); 50 IOSChromeSyncedTabDelegate::CreateForWebState(web_state);
52 InfoBarManagerImpl::CreateForWebState(web_state); 51 InfoBarManagerImpl::CreateForWebState(web_state);
53 IOSSecurityStateTabHelper::CreateForWebState(web_state); 52 IOSSecurityStateTabHelper::CreateForWebState(web_state);
54 RepostFormTabHelper::CreateForWebState(web_state); 53 RepostFormTabHelper::CreateForWebState(web_state);
55 BlockedPopupTabHelper::CreateForWebState(web_state); 54 BlockedPopupTabHelper::CreateForWebState(web_state);
56 FindTabHelper::CreateForWebState(web_state, tab.findInPageControllerDelegate); 55 FindTabHelper::CreateForWebState(web_state, tab.findInPageControllerDelegate);
57 StoreKitTabHelper::CreateForWebState(web_state); 56 StoreKitTabHelper::CreateForWebState(web_state);
58 57
59 if (reading_list::switches::IsReadingListEnabled()) { 58 ReadingListModel* model =
60 ReadingListModel* model = 59 ReadingListModelFactory::GetForBrowserState(browser_state);
61 ReadingListModelFactory::GetForBrowserState(browser_state); 60 ReadingListWebStateObserver::FromWebState(web_state, model);
62 ReadingListWebStateObserver::FromWebState(web_state, model);
63 }
64 61
65 if (AccountConsistencyService* account_consistency_service = 62 if (AccountConsistencyService* account_consistency_service =
66 ios::AccountConsistencyServiceFactory::GetForBrowserState( 63 ios::AccountConsistencyServiceFactory::GetForBrowserState(
67 browser_state)) { 64 browser_state)) {
68 account_consistency_service->SetWebStateHandler(web_state, tab); 65 account_consistency_service->SetWebStateHandler(web_state, tab);
69 } 66 }
70 ChromeIOSTranslateClient::CreateForWebState(web_state); 67 ChromeIOSTranslateClient::CreateForWebState(web_state);
71 68
72 ios::ChromeBrowserState* original_browser_state = 69 ios::ChromeBrowserState* original_browser_state =
73 browser_state->GetOriginalChromeBrowserState(); 70 browser_state->GetOriginalChromeBrowserState();
74 favicon::WebFaviconDriver::CreateForWebState( 71 favicon::WebFaviconDriver::CreateForWebState(
75 web_state, 72 web_state,
76 ios::FaviconServiceFactory::GetForBrowserState( 73 ios::FaviconServiceFactory::GetForBrowserState(
77 original_browser_state, ServiceAccessType::IMPLICIT_ACCESS), 74 original_browser_state, ServiceAccessType::IMPLICIT_ACCESS),
78 ios::HistoryServiceFactory::GetForBrowserState( 75 ios::HistoryServiceFactory::GetForBrowserState(
79 original_browser_state, ServiceAccessType::IMPLICIT_ACCESS), 76 original_browser_state, ServiceAccessType::IMPLICIT_ACCESS),
80 ios::BookmarkModelFactory::GetForBrowserState(original_browser_state)); 77 ios::BookmarkModelFactory::GetForBrowserState(original_browser_state));
81 history::WebStateTopSitesObserver::CreateForWebState( 78 history::WebStateTopSitesObserver::CreateForWebState(
82 web_state, 79 web_state,
83 ios::TopSitesFactory::GetForBrowserState(original_browser_state).get()); 80 ios::TopSitesFactory::GetForBrowserState(original_browser_state).get());
84 81
85 // Allow the embedder to attach tab helpers. 82 // Allow the embedder to attach tab helpers.
86 ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state, tab); 83 ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state, tab);
87 } 84 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698