Commit 74bafc2d authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Create ReadingListCoordinator.

This CL creates ReadingListCoordinator, which uses UITableViews and
replaces the old UICollectionView-based implementation.

Bug: 805209
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I59acbe85cb389c69462bb72ddb7858acb1249c55
Reviewed-on: https://chromium-review.googlesource.com/1104941
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572157}
parent 7c182420
......@@ -180,6 +180,7 @@
#import "ios/chrome/browser/ui/qr_scanner/requirements/qr_scanner_presenting.h"
#import "ios/chrome/browser/ui/reading_list/legacy_reading_list_coordinator.h"
#import "ios/chrome/browser/ui/reading_list/offline_page_native_content.h"
#import "ios/chrome/browser/ui/reading_list/reading_list_coordinator.h"
#import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h"
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.h"
#include "ios/chrome/browser/ui/rtl_geometry.h"
......@@ -487,7 +488,7 @@ NSString* const kBrowserViewControllerSnackbarCategory =
scoped_refptr<VoiceSearchController> _voiceSearchController;
// Used to display the Reading List.
LegacyReadingListCoordinator* _readingListCoordinator;
ChromeCoordinator* _readingListCoordinator;
// Used to display the Find In Page UI. Nil if not visible.
FindBarControllerIOS* _findBarController;
......@@ -4694,10 +4695,16 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
}
- (void)showReadingList {
_readingListCoordinator = [[LegacyReadingListCoordinator alloc]
initWithBaseViewController:self
browserState:self.browserState
loader:self];
_readingListCoordinator =
experimental_flags::IsReadingListUIRebootEnabled()
? [[ReadingListCoordinator alloc]
initWithBaseViewController:self
browserState:self.browserState
loader:self]
: [[LegacyReadingListCoordinator alloc]
initWithBaseViewController:self
browserState:self.browserState
loader:self];
[_readingListCoordinator start];
}
......
......@@ -10,6 +10,8 @@ source_set("reading_list") {
"offline_page_native_content.mm",
"reading_list_collection_view_item.h",
"reading_list_collection_view_item.mm",
"reading_list_coordinator.h",
"reading_list_coordinator.mm",
"reading_list_list_item.h",
"reading_list_list_item_custom_action_factory.h",
"reading_list_list_item_custom_action_factory.mm",
......@@ -53,6 +55,8 @@ source_set("reading_list") {
"//ios/chrome/browser/ui/reading_list/resources:distillation_fail_new",
"//ios/chrome/browser/ui/side_swipe",
"//ios/chrome/browser/ui/static_content",
"//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/table_view:presentation",
"//ios/chrome/browser/ui/table_view:styler",
"//ios/chrome/browser/ui/table_view/cells",
"//ios/chrome/browser/ui/util",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_READING_LIST_READING_LIST_COORDINATOR_H_
#define IOS_CHROME_BROWSER_UI_READING_LIST_READING_LIST_COORDINATOR_H_
#import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h"
@protocol UrlLoader;
// Coordinator for Reading List, displaying the Reading List when starting.
@interface ReadingListCoordinator : ChromeCoordinator
// Designated initialier for a ReadingListCoordinator that loads reading list
// items using |loader|.
- (nullable instancetype)
initWithBaseViewController:(nullable UIViewController*)viewController
browserState:(nonnull ios::ChromeBrowserState*)browserState
loader:(nullable id<UrlLoader>)loader
NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithBaseViewController:
(nullable UIViewController*)viewController NS_UNAVAILABLE;
- (nullable instancetype)
initWithBaseViewController:(nullable UIViewController*)viewController
browserState:(nullable ios::ChromeBrowserState*)browserState
NS_UNAVAILABLE;
@end
#endif // IOS_CHROME_BROWSER_UI_READING_LIST_READING_LIST_COORDINATOR_H_
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment