Commit 1229a23c authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix status bar appearance when BVC is contained

This CL fixes the status bar appearance when the BVC is contained
instead of presented. With it, the TabGrid is forwarding calls to
get the status bar style to BVC.

Bug: 1042235, 1038034
Change-Id: Ibb1bce3a201fa3328add33ad012ef9ec0478aa0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022654
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735797}
parent e48682d8
......@@ -286,6 +286,11 @@
if (base::FeatureList::IsEnabled(kContainedBVC)) {
[self.baseViewController contentWillAppearAnimated:NO];
[self.bvcContainer willMoveToParentViewController:nil];
self.baseViewController.childViewControllerForStatusBarStyle = nil;
// TODO(crbug.com/1038034): This should be part of the animation block.
[self.baseViewController setNeedsStatusBarAppearanceUpdate];
[self.bvcContainer.view removeFromSuperview];
[self.bvcContainer removeFromParentViewController];
self.bvcContainer = nil;
......@@ -345,8 +350,15 @@
if (base::FeatureList::IsEnabled(kContainedBVC)) {
[self.baseViewController addChildViewController:self.bvcContainer];
self.baseViewController.childViewControllerForStatusBarStyle =
self.bvcContainer.currentBVC;
self.bvcContainer.view.frame = self.baseViewController.view.bounds;
[self.baseViewController.view addSubview:self.bvcContainer.view];
// TODO(crbug.com/1038034): This should be part of the animation block.
[self.baseViewController setNeedsStatusBarAppearanceUpdate];
[self.bvcContainer didMoveToParentViewController:self.baseViewController];
extendedCompletion();
} else {
......
......@@ -48,6 +48,11 @@
@property(nonatomic, weak) id<GridImageDataSource> regularTabsImageDataSource;
@property(nonatomic, weak) id<GridImageDataSource> incognitoTabsImageDataSource;
// Readwrite override of the UIViewController property. This object will ignore
// the value supplied by UIViewController.
@property(nonatomic, weak, readwrite)
UIViewController* childViewControllerForStatusBarStyle;
// The view controller for remote tabs.
// TODO(crbug.com/845192) : This was only exposed in the public interface so
// that TabGridViewController does not need to know about model objects. The
......
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