New issue
Advanced search Search tips

Issue 822524 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Task
Q1



Sign in to add a comment

Use willMoveToSuperview for setting up views

Project Member Reported by edchin@chromium.org, Mar 16 2018

Issue description

This technique/practice is a good one, so let's put it to use over setting up in -init.

I'll quickly refactor some existing tab_grid classes.

- (void)willMoveToSuperview:(UIView*)newSuperview {
  // The first time this moves to a superview, perform the view setup.
  if (newSuperview && self.subviews.count == 0) {
    [self setupViews];
  }
}
 
Components: UI>Browser
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a

commit 5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a
Author: edchin <edchin@chromium.org>
Date: Fri Mar 16 19:52:02 2018

[ios] Polish tab grid (part 1)

This CL moves magic numbers to constants files:

- Various dimensions in GridCell
- Margins and height of TabGridTopToolbar
- Margins and height of TabGridBottomToolbar

This CL also changes the toolbar classes to use
|-willMoveToSuperview:| to setup views instead of
|-init|.

Bug:  818198 ,  822524 

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ib4dcfd344c29c3e0ccee103b6002dd6e1d14fb30
Reviewed-on: https://chromium-review.googlesource.com/965576
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: edchin <edchin@chromium.org>
Reviewed-by: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543790}
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/BUILD.gn
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/grid_cell.mm
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/grid_constants.h
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/grid_constants.mm
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_bottom_toolbar.h
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_bottom_toolbar.mm
[add] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_constants.h
[add] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_constants.mm
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_top_toolbar.h
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_top_toolbar.mm
[modify] https://crrev.com/5d4b93700f5337442a4ea98ac4b2ee9b00dfc40a/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm

Comment 3 by edchin@chromium.org, Mar 17 2018

Status: Fixed (was: Assigned)

Sign in to add a comment