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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm

Issue 124383010: [rAC] Allow clickthrough for SuggestionView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit test. Created 6 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
Index: chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm
index d5ee3207d7e08cdd9b764b021bb44008630d6102..fa4d39a1e88dc7ba0b54ed9bd7b17f084465d987 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_suggestion_container.mm
@@ -54,6 +54,34 @@ const CGFloat kLabelWithInputTopPadding = 5.0;
@end
+@interface AutofillSuggestionView : NSView {
+ @private
+ // The main input field - only view not ignoring mouse events.
+ NSView* inputField_;
+}
+
+@property (assign, nonatomic) NSView* inputField;
+
+@end
+
+
+// The suggestion container should ignore any mouse events unless they occur
+// within the bounds of an editable field.
+@implementation AutofillSuggestionView
+
+@synthesize inputField = inputField_;
+
+- (NSView*)hitTest:(NSPoint)point {
+ NSView* hitView = [super hitTest:point];
+ if ([hitView isDescendantOf:inputField_])
+ return hitView;
+
+ return nil;
+}
+
+@end
+
+
@implementation IconAttachmentCell
- (NSPoint)cellBaselineOffset {
@@ -130,9 +158,11 @@ const CGFloat kLabelWithInputTopPadding = 5.0;
[spacer_ setBoxType:NSBoxSeparator];
[spacer_ setBorderType:NSLineBorder];
- base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]);
+ base::scoped_nsobject<AutofillSuggestionView> view(
+ [[AutofillSuggestionView alloc] initWithFrame:NSZeroRect]);
[view setSubviews:
@[ label_, inputField_, spacer_ ]];
+ [view setInputField:inputField_];
[self setView:view];
}

Powered by Google App Engine
This is Rietveld 408576698