Commit 1abab4c2 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Add dark style to remote tabs

Bug: 804589
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ib1ad651adb3d7c1025ab5e50375bc291cef52aed
Reviewed-on: https://chromium-review.googlesource.com/1090004Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565113}
parent a65096e6
......@@ -76,6 +76,7 @@ source_set("tab_grid_ui") {
"//ios/chrome/browser/ui:ui_util",
"//ios/chrome/browser/ui/recent_tabs:recent_tabs_ui",
"//ios/chrome/browser/ui/tab_grid/transitions",
"//ios/chrome/browser/ui/table_view:styler",
"//ios/chrome/browser/ui/util:constraints_ui",
"//ui/base",
]
......
......@@ -8,6 +8,7 @@
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_table_view_controller.h"
#import "ios/chrome/browser/ui/rtl_geometry.h"
#import "ios/chrome/browser/ui/tab_grid/grid/grid_commands.h"
#import "ios/chrome/browser/ui/tab_grid/grid/grid_constants.h"
#import "ios/chrome/browser/ui/tab_grid/grid/grid_consumer.h"
#import "ios/chrome/browser/ui/tab_grid/grid/grid_image_data_source.h"
#import "ios/chrome/browser/ui/tab_grid/grid/grid_view_controller.h"
......@@ -17,6 +18,7 @@
#import "ios/chrome/browser/ui/tab_grid/tab_grid_new_tab_button.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_page_control.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_top_toolbar.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#import "ios/chrome/browser/ui/uikit_ui_util.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util.h"
......@@ -435,6 +437,12 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// Adds the remote tabs view controller as a contained view controller, and
// sets constraints.
- (void)setupRemoteTabsViewController {
// TODO(crbug.com/804589) : Dark style on remote tabs.
// The styler must be set before the view controller is loaded.
ChromeTableViewStyler* styler = [[ChromeTableViewStyler alloc] init];
styler.tableViewBackgroundColor = UIColorFromRGB(kGridBackgroundColor);
self.remoteTabsViewController.styler = styler;
UIView* contentView = self.scrollContentView;
UIViewController* viewController = self.remoteTabsViewController;
viewController.view.translatesAutoresizingMaskIntoConstraints = NO;
......
......@@ -30,7 +30,7 @@ typedef NS_ENUM(NSInteger, ChromeTableViewControllerStyle) {
// The styler that controls how this table view and its cells are
// displayed. Styler changes should be made before viewDidLoad is called; any
// changes made afterwards are not guaranteed to take effect.
@property(nonatomic, readonly, strong) ChromeTableViewStyler* styler;
@property(nonatomic, readwrite, strong) ChromeTableViewStyler* styler;
// Initializes the view controller, configured with |style|, |appBarStyle|. The
// default ChromeTableViewStyler will be used.
......@@ -38,12 +38,6 @@ typedef NS_ENUM(NSInteger, ChromeTableViewControllerStyle) {
appBarStyle:
(ChromeTableViewControllerStyle)appBarStyle
NS_DESIGNATED_INITIALIZER;
// Initializes the view controller, configured with |style|, |appBarStyle|, and
// |styler|. |styler| can't be nil.
- (instancetype)initWithTableViewStyle:(UITableViewStyle)style
appBarStyle:
(ChromeTableViewControllerStyle)appBarStyle
styler:(ChromeTableViewStyler*)styler;
// Unavailable initializers.
- (instancetype)initWithStyle:(UITableViewStyle)style NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;
......
......@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h"
#include "base/logging.h"
#import "ios/chrome/browser/ui/material_components/utils.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_header_footer_item.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
......@@ -36,21 +37,16 @@
return self;
}
- (instancetype)initWithTableViewStyle:(UITableViewStyle)style
appBarStyle:
(ChromeTableViewControllerStyle)appBarStyle
styler:(ChromeTableViewStyler*)styler {
if (self = [self initWithTableViewStyle:style appBarStyle:appBarStyle]) {
_styler = styler;
}
return self;
}
- (instancetype)init {
return [self initWithTableViewStyle:UITableViewStylePlain
appBarStyle:ChromeTableViewControllerStyleNoAppBar];
}
- (void)setStyler:(ChromeTableViewStyler*)styler {
DCHECK(![self isViewLoaded]);
_styler = styler;
}
- (void)loadModel {
_tableViewModel = [[TableViewModel alloc] init];
}
......
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