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

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

Issue 2693863005: Create ReadingListCoordinator (Closed)
Patch Set: Reviewable 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
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 3805 matching lines...) Expand 10 before | Expand all | Expand 10 after
4221 DCHECK(self.visible || self.dismissingModal); 4224 DCHECK(self.visible || self.dismissingModal);
4222 GURL URL(kChromeUIBookmarksURL); 4225 GURL URL(kChromeUIBookmarksURL);
4223 Tab* tab = [_model currentTab]; 4226 Tab* tab = [_model currentTab];
4224 web::NavigationManager::WebLoadParams params(URL); 4227 web::NavigationManager::WebLoadParams params(URL);
4225 params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK; 4228 params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
4226 [[tab webController] loadWithParams:params]; 4229 [[tab webController] loadWithParams:params];
4227 } 4230 }
4228 4231
4229 - (void)showReadingList { 4232 - (void)showReadingList {
4230 DCHECK(reading_list::switches::IsReadingListEnabled()); 4233 DCHECK(reading_list::switches::IsReadingListEnabled());
4231 UIViewController* vc = [ReadingListViewControllerBuilder 4234 _readingListCoordinator.reset([[ReadingListCoordinator alloc]
Olivier 2017/02/16 15:16:09 SHould this be released at some point?
gambard 2017/02/16 15:45:56 What do you mean? It is a scoped_nsobject.
Olivier 2017/02/17 14:12:34 If you show the screen, it will only be dealloced
gambard 2017/02/17 15:47:58 Yes, but we don't want BVC to handle all coordinat
4232 readingListViewControllerInBrowserState:self.browserState 4235 initWithBaseViewController:self
4233 loader:self]; 4236 browserState:self.browserState
4234 [self presentViewController:vc animated:YES completion:nil]; 4237 loader:self]);
4238
4239 [_readingListCoordinator start];
4235 } 4240 }
4236 4241
4237 - (void)showQRScanner { 4242 - (void)showQRScanner {
4238 _qrScannerViewController.reset( 4243 _qrScannerViewController.reset(
4239 [[QRScannerViewController alloc] initWithDelegate:_toolbarController]); 4244 [[QRScannerViewController alloc] initWithDelegate:_toolbarController]);
4240 [self presentViewController:[_qrScannerViewController 4245 [self presentViewController:[_qrScannerViewController
4241 getViewControllerToPresent] 4246 getViewControllerToPresent]
4242 animated:YES 4247 animated:YES
4243 completion:nil]; 4248 completion:nil];
4244 } 4249 }
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
4998 5003
4999 - (UIView*)voiceSearchButton { 5004 - (UIView*)voiceSearchButton {
5000 return _voiceSearchButton; 5005 return _voiceSearchButton;
5001 } 5006 }
5002 5007
5003 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5008 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5004 return [self currentLogoAnimationControllerOwner]; 5009 return [self currentLogoAnimationControllerOwner];
5005 } 5010 }
5006 5011
5007 @end 5012 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698