OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |