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

Side by Side Diff: ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm

Issue 2601943002: [ios] Stop setting omnibox fakebox flag on iPhone. (Closed)
Patch Set: Restore iPad functionality 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h" 5 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h"
6 6
7 #import <CoreLocation/CoreLocation.h> 7 #import <CoreLocation/CoreLocation.h>
8 #include <QuartzCore/QuartzCore.h> 8 #include <QuartzCore/QuartzCore.h>
9 9
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 if (![_webToolbar isHidden]) 1328 if (![_webToolbar isHidden])
1329 [_omniBox becomeFirstResponder]; 1329 [_omniBox becomeFirstResponder];
1330 } 1330 }
1331 1331
1332 - (void)cancelOmniboxEdit { 1332 - (void)cancelOmniboxEdit {
1333 _locationBar->HideKeyboardAndEndEditing(); 1333 _locationBar->HideKeyboardAndEndEditing();
1334 [self updateToolbarState]; 1334 [self updateToolbarState];
1335 } 1335 }
1336 1336
1337 - (void)focusFakebox { 1337 - (void)focusFakebox {
1338 OmniboxEditModel* model = _locationBar->GetLocationEntry()->model(); 1338 if (IsIPadIdiom()) {
1339 // Setting the caret visibility to false causes OmniboxEditModel to indicate 1339 OmniboxEditModel* model = _locationBar->GetLocationEntry()->model();
1340 // that omnibox interaction was initiated from the fakebox. Note that 1340 // Setting the caret visibility to false causes OmniboxEditModel to indicate
1341 // SetCaretVisibility is a no-op unless OnSetFocus is called first. 1341 // that omnibox interaction was initiated from the fakebox. Note that
1342 model->OnSetFocus(false); 1342 // SetCaretVisibility is a no-op unless OnSetFocus is called first.
rohitrao (ping after 24h) 2017/01/10 17:18:45 Add to this explaining why the phone omnibox does
justincohen 2017/01/12 18:04:36 Done.
1343 model->SetCaretVisibility(false); 1343 model->OnSetFocus(false);
1344 1344 model->SetCaretVisibility(false);
1345 if (!IsIPadIdiom()) { 1345 } else {
1346 // Set the omnibox background's frame to full bleed. 1346 // Set the omnibox background's frame to full bleed.
1347 CGRect mobFrame = CGRectInset([_clippingView bounds], -2, -2); 1347 CGRect mobFrame = CGRectInset([_clippingView bounds], -2, -2);
1348 [_omniboxBackground setFrame:mobFrame]; 1348 [_omniboxBackground setFrame:mobFrame];
1349 } 1349 }
1350 1350
1351 [self focusOmnibox]; 1351 [self focusOmnibox];
1352 } 1352 }
1353 1353
1354 - (void)onFakeboxBlur { 1354 - (void)onFakeboxBlur {
1355 DCHECK(!IsIPadIdiom()); 1355 DCHECK(!IsIPadIdiom());
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2562 2562
2563 - (BOOL)isPrerenderAnimationRunning { 2563 - (BOOL)isPrerenderAnimationRunning {
2564 return _prerenderAnimating; 2564 return _prerenderAnimating;
2565 } 2565 }
2566 2566
2567 - (OmniboxTextFieldIOS*)omnibox { 2567 - (OmniboxTextFieldIOS*)omnibox {
2568 return _omniBox.get(); 2568 return _omniBox.get();
2569 } 2569 }
2570 2570
2571 @end 2571 @end
OLDNEW
« 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