summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjif <jif@chromium.org>2016-01-12 04:45:41 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-12 12:47:11 +0000
commit86b92e11f0ff7483f03f9064b07bf220d7d42b68 (patch)
tree1635c89dc67ab42f39185195e0e8a1edb2e9183d
parent5122900f384e6753c1b971762714830d385f2472 (diff)
downloadchromium_src-86b92e11f0ff7483f03f9064b07bf220d7d42b68.zip
chromium_src-86b92e11f0ff7483f03f9064b07bf220d7d42b68.tar.gz
chromium_src-86b92e11f0ff7483f03f9064b07bf220d7d42b68.tar.bz2
Take into account the size of the status bar when computing the frame of the web controller.
BUG=None. Review URL: https://codereview.chromium.org/1580493005 Cr-Commit-Position: refs/heads/master@{#368857}
-rw-r--r--ios/web/web_state/ui/crw_web_controller.mm12
1 files changed, 11 insertions, 1 deletions
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 52cb060..2d7cef0 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1561,9 +1561,19 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
// processed.
_containerView.reset(
[[CRWWebControllerContainerView alloc] initWithDelegate:self]);
- self.containerView.frame =
+
+ // Compute and set the frame of the containerView.
+ UIViewController* rootController =
+ [[UIApplication sharedApplication] keyWindow].rootViewController;
+ DCHECK(rootController);
+ CGFloat statusBarHeight = [rootController.topLayoutGuide length];
+ CGRect containerViewFrame =
[UIApplication sharedApplication].keyWindow.bounds;
+ containerViewFrame.origin.y += statusBarHeight;
+ containerViewFrame.size.height -= statusBarHeight;
+ self.containerView.frame = containerViewFrame;
DCHECK(!CGRectIsEmpty(self.containerView.frame));
+
[self.containerView addGestureRecognizer:[self touchTrackingRecognizer]];
[self.containerView setAccessibilityIdentifier:web::kContainerViewID];
// Is |currentUrl| a web scheme or native chrome scheme.