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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage(); | 636 IDR_AUTOFILL_TOOLTIP_ICON).ToNSImage(); |
637 [tooltipController_ setImage:icon]; | 637 [tooltipController_ setImage:icon]; |
638 [tooltipController_ setMessage:tooltipText]; | 638 [tooltipController_ setMessage:tooltipText]; |
639 [[field cell] setDecorationSize:[icon size]]; | 639 [[field cell] setDecorationSize:[icon size]]; |
640 } | 640 } |
641 [field setDefaultValue:@""]; | 641 [field setDefaultValue:@""]; |
642 control.reset(field.release()); | 642 control.reset(field.release()); |
643 } | 643 } |
644 [control setFieldValue:base::SysUTF16ToNSString(input.initial_value)]; | 644 [control setFieldValue:base::SysUTF16ToNSString(input.initial_value)]; |
645 [control sizeToFit]; | 645 [control sizeToFit]; |
| 646 [control setFrame:NSIntegralRect([control frame])]; |
646 [control setTag:input.type]; | 647 [control setTag:input.type]; |
647 [control setInputDelegate:self]; | 648 [control setInputDelegate:self]; |
648 // Hide away fields that cannot be edited. | 649 // Hide away fields that cannot be edited. |
649 if (kColumnSetId == -1) { | 650 if (kColumnSetId == -1) { |
650 [control setFrame:NSZeroRect]; | 651 [control setFrame:NSZeroRect]; |
651 [control setHidden:YES]; | 652 [control setHidden:YES]; |
652 } | 653 } |
653 layout->AddView(control); | 654 layout->AddView(control); |
654 | 655 |
655 if (input.length == autofill::DetailInput::LONG || | 656 if (input.length == autofill::DetailInput::LONG || |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 715 |
715 - (void)activateFieldForType:(autofill::ServerFieldType)type { | 716 - (void)activateFieldForType:(autofill::ServerFieldType)type { |
716 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:type]; | 717 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:type]; |
717 if (field) { | 718 if (field) { |
718 [[field window] makeFirstResponder:field]; | 719 [[field window] makeFirstResponder:field]; |
719 [self textfieldEditedOrActivated:field edited:NO]; | 720 [self textfieldEditedOrActivated:field edited:NO]; |
720 } | 721 } |
721 } | 722 } |
722 | 723 |
723 @end | 724 @end |
OLD | NEW |