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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_section_container.mm

Issue 100903003: [rAC, OSX] Fix key handling for autofill popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/autofill/autofill_section_container.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 [suggestButton_ setFrame:buttonFrame]; 249 [suggestButton_ setFrame:buttonFrame];
250 [inputs_ setHidden:showSuggestions_]; 250 [inputs_ setHidden:showSuggestions_];
251 [[suggestContainer_ view] setHidden:!showSuggestions_]; 251 [[suggestContainer_ view] setHidden:!showSuggestions_];
252 [view_ setFrameSize:viewFrame.size]; 252 [view_ setFrameSize:viewFrame.size];
253 } 253 }
254 254
255 - (KeyEventHandled)keyEvent:(NSEvent*)event forInput:(id)sender { 255 - (KeyEventHandled)keyEvent:(NSEvent*)event forInput:(id)sender {
256 content::NativeWebKeyboardEvent webEvent(event); 256 content::NativeWebKeyboardEvent webEvent(event);
257 257
258 // Only handle keyDown, to handle key repeats without duplicates. 258 // Only handle keyDown, to handle key repeats without duplicates.
259 if (webEvent.type != content::NativeWebKeyboardEvent::KeyDown) 259 if (webEvent.type != content::NativeWebKeyboardEvent::RawKeyDown)
260 return kKeyEventNotHandled; 260 return kKeyEventNotHandled;
261 261
262 // Allow the delegate to intercept key messages. 262 // Allow the delegate to intercept key messages.
263 if (delegate_->HandleKeyPressEventInInput(webEvent)) 263 if (delegate_->HandleKeyPressEventInInput(webEvent))
264 return kKeyEventHandled; 264 return kKeyEventHandled;
265 return kKeyEventNotHandled; 265 return kKeyEventNotHandled;
266 } 266 }
267 267
268 - (void)onMouseDown:(NSControl<AutofillInputField>*)field { 268 - (void)onMouseDown:(NSControl<AutofillInputField>*)field {
269 [self textfieldEditedOrActivated:field edited:NO]; 269 [self textfieldEditedOrActivated:field edited:NO];
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 - (void)activateFieldForInput:(const autofill::DetailInput&)input { 649 - (void)activateFieldForInput:(const autofill::DetailInput&)input {
650 if ([self detailInputForType:input.type] != &input) 650 if ([self detailInputForType:input.type] != &input)
651 return; 651 return;
652 652
653 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:input.type]; 653 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:input.type];
654 [[field window] makeFirstResponder:field]; 654 [[field window] makeFirstResponder:field];
655 [self textfieldEditedOrActivated:field edited:NO]; 655 [self textfieldEditedOrActivated:field edited:NO];
656 } 656 }
657 657
658 @end 658 @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