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

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2693863005: Create ReadingListCoordinator (Closed)
Patch Set: Address comments Created 3 years, 10 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 | « no previous file | ios/chrome/browser/ui/reading_list/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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/ui/browser_view_controller.h" 5 #import "ios/chrome/browser/ui/browser_view_controller.h"
6 6
7 #import <AssetsLibrary/AssetsLibrary.h> 7 #import <AssetsLibrary/AssetsLibrary.h>
8 #import <MobileCoreServices/MobileCoreServices.h> 8 #import <MobileCoreServices/MobileCoreServices.h>
9 #import <PassKit/PassKit.h> 9 #import <PassKit/PassKit.h>
10 #import <Photos/Photos.h> 10 #import <Photos/Photos.h>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 #import "ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_view_controller .h" 126 #import "ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_view_controller .h"
127 #include "ios/chrome/browser/ui/omnibox/page_info_model.h" 127 #include "ios/chrome/browser/ui/omnibox/page_info_model.h"
128 #import "ios/chrome/browser/ui/omnibox/page_info_view_controller.h" 128 #import "ios/chrome/browser/ui/omnibox/page_info_view_controller.h"
129 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller. h" 129 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller. h"
130 #import "ios/chrome/browser/ui/page_not_available_controller.h" 130 #import "ios/chrome/browser/ui/page_not_available_controller.h"
131 #import "ios/chrome/browser/ui/preload_controller.h" 131 #import "ios/chrome/browser/ui/preload_controller.h"
132 #import "ios/chrome/browser/ui/preload_controller_delegate.h" 132 #import "ios/chrome/browser/ui/preload_controller_delegate.h"
133 #import "ios/chrome/browser/ui/print/print_controller.h" 133 #import "ios/chrome/browser/ui/print/print_controller.h"
134 #import "ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h" 134 #import "ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h"
135 #import "ios/chrome/browser/ui/reading_list/offline_page_native_content.h" 135 #import "ios/chrome/browser/ui/reading_list/offline_page_native_content.h"
136 #import "ios/chrome/browser/ui/reading_list/reading_list_coordinator.h"
136 #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h" 137 #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h"
137 #import "ios/chrome/browser/ui/reading_list/reading_list_view_controller_builder .h"
138 #include "ios/chrome/browser/ui/rtl_geometry.h" 138 #include "ios/chrome/browser/ui/rtl_geometry.h"
139 #import "ios/chrome/browser/ui/side_swipe/side_swipe_controller.h" 139 #import "ios/chrome/browser/ui/side_swipe/side_swipe_controller.h"
140 #import "ios/chrome/browser/ui/stack_view/card_view.h" 140 #import "ios/chrome/browser/ui/stack_view/card_view.h"
141 #import "ios/chrome/browser/ui/stack_view/page_animation_util.h" 141 #import "ios/chrome/browser/ui/stack_view/page_animation_util.h"
142 #import "ios/chrome/browser/ui/static_content/static_html_native_content.h" 142 #import "ios/chrome/browser/ui/static_content/static_html_native_content.h"
143 #import "ios/chrome/browser/ui/sync/sync_util.h" 143 #import "ios/chrome/browser/ui/sync/sync_util.h"
144 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h" 144 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h"
145 #import "ios/chrome/browser/ui/tabs/tab_strip_controller.h" 145 #import "ios/chrome/browser/ui/tabs/tab_strip_controller.h"
146 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" 146 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h"
147 #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h" 147 #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 // Used to display the Page Info UI. Nil if not visible. 397 // Used to display the Page Info UI. Nil if not visible.
398 base::scoped_nsobject<PageInfoViewController> _pageInfoController; 398 base::scoped_nsobject<PageInfoViewController> _pageInfoController;
399 399
400 // Used to display the Voice Search UI. Nil if not visible. 400 // Used to display the Voice Search UI. Nil if not visible.
401 scoped_refptr<VoiceSearchController> _voiceSearchController; 401 scoped_refptr<VoiceSearchController> _voiceSearchController;
402 402
403 // Used to display the QR Scanner UI. Nil if not visible. 403 // Used to display the QR Scanner UI. Nil if not visible.
404 base::scoped_nsobject<QRScannerViewController> _qrScannerViewController; 404 base::scoped_nsobject<QRScannerViewController> _qrScannerViewController;
405 405
406 // Used to display the Reading List.
407 base::scoped_nsobject<ReadingListCoordinator> _readingListCoordinator;
408
406 // Used to display the Suggestions. 409 // Used to display the Suggestions.
407 base::scoped_nsobject<ContentSuggestionsCoordinator> 410 base::scoped_nsobject<ContentSuggestionsCoordinator>
408 _contentSuggestionsCoordinator; 411 _contentSuggestionsCoordinator;
409 412
410 // Used to display the Find In Page UI. Nil if not visible. 413 // Used to display the Find In Page UI. Nil if not visible.
411 base::scoped_nsobject<FindBarControllerIOS> _findBarController; 414 base::scoped_nsobject<FindBarControllerIOS> _findBarController;
412 415
413 // Used to display the Print UI. Nil if not visible. 416 // Used to display the Print UI. Nil if not visible.
414 base::scoped_nsobject<PrintController> _printController; 417 base::scoped_nsobject<PrintController> _printController;
415 418
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 loader->PurgeCache(); 1277 loader->PurgeCache();
1275 } 1278 }
1276 1279
1277 if (![self isViewLoaded]) { 1280 if (![self isViewLoaded]) {
1278 // Do not release |_infoBarContainer|, as this must have the same lifecycle 1281 // Do not release |_infoBarContainer|, as this must have the same lifecycle
1279 // as the BrowserViewController. 1282 // as the BrowserViewController.
1280 self.contentArea = nil; 1283 self.contentArea = nil;
1281 self.typingShield = nil; 1284 self.typingShield = nil;
1282 if (_voiceSearchController.get()) 1285 if (_voiceSearchController.get())
1283 _voiceSearchController->SetDelegate(nil); 1286 _voiceSearchController->SetDelegate(nil);
1287 _contentSuggestionsCoordinator.reset();
1284 _qrScannerViewController.reset(); 1288 _qrScannerViewController.reset();
1289 _readingListCoordinator.reset();
1285 _toolbarController.reset(); 1290 _toolbarController.reset();
1286 _toolbarModelDelegate.reset(); 1291 _toolbarModelDelegate.reset();
1287 _toolbarModelIOS.reset(); 1292 _toolbarModelIOS.reset();
1288 _tabStripController.reset(); 1293 _tabStripController.reset();
1289 _sideSwipeController.reset(); 1294 _sideSwipeController.reset();
1290 } 1295 }
1291 } 1296 }
1292 1297
1293 - (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection { 1298 - (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection {
1294 [super traitCollectionDidChange:previousTraitCollection]; 1299 [super traitCollectionDidChange:previousTraitCollection];
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after
4221 DCHECK(self.visible || self.dismissingModal); 4226 DCHECK(self.visible || self.dismissingModal);
4222 GURL URL(kChromeUIBookmarksURL); 4227 GURL URL(kChromeUIBookmarksURL);
4223 Tab* tab = [_model currentTab]; 4228 Tab* tab = [_model currentTab];
4224 web::NavigationManager::WebLoadParams params(URL); 4229 web::NavigationManager::WebLoadParams params(URL);
4225 params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK; 4230 params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
4226 [[tab webController] loadWithParams:params]; 4231 [[tab webController] loadWithParams:params];
4227 } 4232 }
4228 4233
4229 - (void)showReadingList { 4234 - (void)showReadingList {
4230 DCHECK(reading_list::switches::IsReadingListEnabled()); 4235 DCHECK(reading_list::switches::IsReadingListEnabled());
4231 UIViewController* vc = [ReadingListViewControllerBuilder 4236 _readingListCoordinator.reset([[ReadingListCoordinator alloc]
4232 readingListViewControllerInBrowserState:self.browserState 4237 initWithBaseViewController:self
4233 loader:self]; 4238 browserState:self.browserState
4234 [self presentViewController:vc animated:YES completion:nil]; 4239 loader:self]);
4240
4241 [_readingListCoordinator start];
4235 } 4242 }
4236 4243
4237 - (void)showQRScanner { 4244 - (void)showQRScanner {
4238 _qrScannerViewController.reset( 4245 _qrScannerViewController.reset(
4239 [[QRScannerViewController alloc] initWithDelegate:_toolbarController]); 4246 [[QRScannerViewController alloc] initWithDelegate:_toolbarController]);
4240 [self presentViewController:[_qrScannerViewController 4247 [self presentViewController:[_qrScannerViewController
4241 getViewControllerToPresent] 4248 getViewControllerToPresent]
4242 animated:YES 4249 animated:YES
4243 completion:nil]; 4250 completion:nil];
4244 } 4251 }
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
4998 5005
4999 - (UIView*)voiceSearchButton { 5006 - (UIView*)voiceSearchButton {
5000 return _voiceSearchButton; 5007 return _voiceSearchButton;
5001 } 5008 }
5002 5009
5003 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5010 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5004 return [self currentLogoAnimationControllerOwner]; 5011 return [self currentLogoAnimationControllerOwner];
5005 } 5012 }
5006 5013
5007 @end 5014 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/reading_list/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698