| OLD | NEW |
| 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 Loading... |
| 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. Only |
| 1343 model->SetCaretVisibility(false); | 1343 // set fakebox on iPad, where there is a distinction between the omnibox |
| 1344 | 1344 // and the fakebox on the NTP. On iPhone there is no visible omnibox, so |
| 1345 if (!IsIPadIdiom()) { | 1345 // there's no need to indicate interaction was initiated from the fakebox. |
| 1346 model->OnSetFocus(false); |
| 1347 model->SetCaretVisibility(false); |
| 1348 } else { |
| 1346 // Set the omnibox background's frame to full bleed. | 1349 // Set the omnibox background's frame to full bleed. |
| 1347 CGRect mobFrame = CGRectInset([_clippingView bounds], -2, -2); | 1350 CGRect mobFrame = CGRectInset([_clippingView bounds], -2, -2); |
| 1348 [_omniboxBackground setFrame:mobFrame]; | 1351 [_omniboxBackground setFrame:mobFrame]; |
| 1349 } | 1352 } |
| 1350 | 1353 |
| 1351 [self focusOmnibox]; | 1354 [self focusOmnibox]; |
| 1352 } | 1355 } |
| 1353 | 1356 |
| 1354 - (void)onFakeboxBlur { | 1357 - (void)onFakeboxBlur { |
| 1355 DCHECK(!IsIPadIdiom()); | 1358 DCHECK(!IsIPadIdiom()); |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2562 | 2565 |
| 2563 - (BOOL)isPrerenderAnimationRunning { | 2566 - (BOOL)isPrerenderAnimationRunning { |
| 2564 return _prerenderAnimating; | 2567 return _prerenderAnimating; |
| 2565 } | 2568 } |
| 2566 | 2569 |
| 2567 - (OmniboxTextFieldIOS*)omnibox { | 2570 - (OmniboxTextFieldIOS*)omnibox { |
| 2568 return _omniBox.get(); | 2571 return _omniBox.get(); |
| 2569 } | 2572 } |
| 2570 | 2573 |
| 2571 @end | 2574 @end |
| OLD | NEW |