Commit 7fc6a61d authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Manage adaptive primary toolbar's fakebox tap

Bug: 803372
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Icdfc2ee6450ab03cf357792cc3ad6d0060baf58e
Reviewed-on: https://chromium-review.googlesource.com/891518
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533303}
parent 3c311875
......@@ -41,7 +41,6 @@
- (void)updateForSideSwipeSnapshotOnNTP:(BOOL)onNTP {
self.view.progressBar.hidden = YES;
// TODO(crbug.com/804848): Have the correct appearance on NTP.
// TODO(crbug.com/804850): Have the correct background color for incognito
// NTP.
}
......
......@@ -109,15 +109,27 @@
#pragma mark - FakeboxFocuser
- (void)focusFakebox {
// TODO(crbug.com/803372): Implement that.
if (IsIPadIdiom()) {
// On iPhone there is no visible omnibox, so there's no need to indicate
// interaction was initiated from the fakebox.
[self.locationBarCoordinator focusOmniboxFromFakebox];
}
[self.locationBarCoordinator focusOmnibox];
}
- (void)onFakeboxBlur {
// TODO(crbug.com/803372): Implement that.
DCHECK(!IsIPadIdiom());
// Hide the toolbar if the NTP is currently displayed.
web::WebState* webState = self.webStateList->GetActiveWebState();
if (webState && IsVisibleUrlNewTabPage(webState)) {
self.viewController.view.hidden = YES;
}
}
- (void)onFakeboxAnimationComplete {
// TODO(crbug.com/803372): Implement that.
DCHECK(!IsIPadIdiom());
self.viewController.view.hidden = NO;
}
// TODO(crbug.com/786940): This protocol should move to the ViewController
......
......@@ -52,11 +52,15 @@
if (!onNTP)
return;
self.view.backgroundColor =
self.buttonFactory.toolbarConfiguration.NTPBackgroundColor;
self.view.locationBarContainer.hidden = YES;
}
- (void)resetAfterSideSwipeSnapshot {
[super resetAfterSideSwipeSnapshot];
self.view.backgroundColor =
self.buttonFactory.toolbarConfiguration.backgroundColor;
self.view.locationBarContainer.hidden = NO;
}
......
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