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

Unified Diff: ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm

Issue 2917703003: [ios] Remove hitTest UIKit workaround. (Closed)
Patch Set: Created 3 years, 7 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/omnibox/omnibox_text_field_ios.mm
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
index 64020a711201f11c6d7ae81db8e1fc1865d881df..1180cf6b75987b1c03cfa0e5866ef4cccc57d712 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -790,26 +790,7 @@ NSString* const kOmniboxFadeAnimationKey = @"OmniboxFadeAnimation";
// will also activate the text field.
if (point.y < 0)
point.y = 0;
- UIView* view = [super hitTest:point withEvent:event];
-
- // For some reason when the |leftView| has interaction enabled, hitTest
- // returns the leftView even when |point| is 50 pixels to the right. Tapping
- // the hint text will fire the leftView, causing b/6281652. Fails especially
- // on iPad and iPhone devices in landscape mode.
- // TODO(crbug.com/546295): Check to see if this UIKit bug is fixed, and remove
- // this workaround.
- UIView* leftView = [self leftView];
- if (leftView) {
- if (leftView == view && !CGRectContainsPoint([leftView frame], point)) {
- return self;
- } else if ([self leftViewMode] == UITextFieldViewModeAlways) {
- CGRect targetFrame = CGRectInset([leftView frame], -5, -5);
- if (CGRectContainsPoint(targetFrame, point)) {
- return leftView;
- }
- }
- }
- return view;
+ return [super hitTest:point withEvent:event];
}
- (BOOL)isTextFieldLTR {
« 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