Commit ddda90f3 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix StatusBar appearance when switching mode

This CL makes sure that the status bar appearance is correctly updated
when switching mode (icognito/normal) through opening a new tab.
The status bar theme is chosen based on the
childViewControllerForStatusBarStyle property of the TabGrid.
The notification of UIKit is done at the same time as the child view
controller is updated.

Fixed: 1122239
Change-Id: I847c4d1d70148cabbd824e4bdb40b7aa6fd50847
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2395735Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804851}
parent 4a41eb42
...@@ -43,10 +43,6 @@ ...@@ -43,10 +43,6 @@
[self.view addSubview:bvc.view]; [self.view addSubview:bvc.view];
[bvc didMoveToParentViewController:self]; [bvc didMoveToParentViewController:self];
// Let the system know that the child has changed so appearance updates can
// be made.
[self setNeedsStatusBarAppearanceUpdate];
if (IsThumbStripEnabled()) { if (IsThumbStripEnabled()) {
// The background needs to be clear to allow the thumb strip to be seen // The background needs to be clear to allow the thumb strip to be seen
// during the enter/exit thumb strip animation. // during the enter/exit thumb strip animation.
......
...@@ -216,6 +216,9 @@ ...@@ -216,6 +216,9 @@
// container. // container.
if (self.bvcContainer) { if (self.bvcContainer) {
self.bvcContainer.currentBVC = viewController; self.bvcContainer.currentBVC = viewController;
self.baseViewController.childViewControllerForStatusBarStyle =
viewController;
[self.baseViewController setNeedsStatusBarAppearanceUpdate];
if (completion) { if (completion) {
completion(); completion();
} }
......
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