Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm

Issue 2601943002: [ios] Stop setting omnibox fakebox flag on iPhone. (Closed)
Patch Set: Update comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
diff --git a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
index 85cdcae7446fe88ee8e1fbff2ffba86eca99a7c2..d31f77e3f0a72766b2057cfa9bb4ff0f3c5637d5 100644
--- a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
+++ b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
@@ -1335,14 +1335,17 @@ CGRect RectShiftedDownAndResizedForStatusBar(CGRect rect) {
}
- (void)focusFakebox {
- OmniboxEditModel* model = _locationBar->GetLocationEntry()->model();
- // Setting the caret visibility to false causes OmniboxEditModel to indicate
- // that omnibox interaction was initiated from the fakebox. Note that
- // SetCaretVisibility is a no-op unless OnSetFocus is called first.
- model->OnSetFocus(false);
- model->SetCaretVisibility(false);
-
- if (!IsIPadIdiom()) {
+ if (IsIPadIdiom()) {
+ OmniboxEditModel* model = _locationBar->GetLocationEntry()->model();
+ // Setting the caret visibility to false causes OmniboxEditModel to indicate
+ // that omnibox interaction was initiated from the fakebox. Note that
+ // SetCaretVisibility is a no-op unless OnSetFocus is called first. Only
+ // set fakebox on iPad, where there is a distinction between the omnibox
+ // and the fakebox on the NTP. On iPhone there is no visible omnibox, so
+ // there's no need to indicate interaction was initiated from the fakebox.
+ model->OnSetFocus(false);
+ model->SetCaretVisibility(false);
+ } else {
// Set the omnibox background's frame to full bleed.
CGRect mobFrame = CGRectInset([_clippingView bounds], -2, -2);
[_omniboxBackground setFrame:mobFrame];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698