Commit 844af309 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Remove rootViewController usage from omnibox

The call to |-rootViewController| is used to calculate the size of the
autocomplete popup view in tablet, relative to the keyboard being shown.

We now convert to the mainScreen coordinate space, which is the
intended use of |-rootViewController|.

Bug: 791787
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ib6c8a6de473005de9ec2ce899990653662c1b64f
Reviewed-on: https://chromium-review.googlesource.com/882311
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532002}
parent c5bf341b
...@@ -359,10 +359,9 @@ UIColor* BackgroundColorIncognito() { ...@@ -359,10 +359,9 @@ UIColor* BackgroundColorIncognito() {
} }
- (void)updateContentInsetForKeyboard { - (void)updateContentInsetForKeyboard {
UIView* toView =
[UIApplication sharedApplication].keyWindow.rootViewController.view;
CGRect absoluteRect = CGRect absoluteRect =
[self.tableView convertRect:self.tableView.bounds toView:toView]; [self.tableView convertRect:self.tableView.bounds
toCoordinateSpace:UIScreen.mainScreen.coordinateSpace];
CGFloat screenHeight = CurrentScreenHeight(); CGFloat screenHeight = CurrentScreenHeight();
CGFloat bottomInset = screenHeight - self.tableView.contentSize.height - CGFloat bottomInset = screenHeight - self.tableView.contentSize.height -
_keyboardHeight - absoluteRect.origin.y - _keyboardHeight - absoluteRect.origin.y -
......
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