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

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

Issue 63053003: Ask libaddressinput for address components to use in requestAutocomplete(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: let's try this again, android 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
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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 [popup addItemWithTitle: 578 [popup addItemWithTitle:
579 base::SysUTF16ToNSString(inputModel->GetItemAt(i))]; 579 base::SysUTF16ToNSString(inputModel->GetItemAt(i))];
580 } 580 }
581 [popup setDefaultValue:base::SysUTF16ToNSString( 581 [popup setDefaultValue:base::SysUTF16ToNSString(
582 inputModel->GetItemAt(inputModel->GetDefaultIndex()))]; 582 inputModel->GetItemAt(inputModel->GetDefaultIndex()))];
583 control.reset(popup.release()); 583 control.reset(popup.release());
584 } else { 584 } else {
585 base::scoped_nsobject<AutofillTextField> field( 585 base::scoped_nsobject<AutofillTextField> field(
586 [[AutofillTextField alloc] init]); 586 [[AutofillTextField alloc] init]);
587 [[field cell] setPlaceholderString: 587 [[field cell] setPlaceholderString:
588 l10n_util::GetNSStringWithFixup(input.placeholder_text_rid)]; 588 base::SysUTF16ToNSString(input.placeholder_text)];
589 [field setDefaultValue:@""]; 589 [field setDefaultValue:@""];
590 control.reset(field.release()); 590 control.reset(field.release());
591 } 591 }
592 [control setFieldValue:base::SysUTF16ToNSString(input.initial_value)]; 592 [control setFieldValue:base::SysUTF16ToNSString(input.initial_value)];
593 [control sizeToFit]; 593 [control sizeToFit];
594 [control setTag:input.type]; 594 [control setTag:input.type];
595 [control setInputDelegate:self]; 595 [control setInputDelegate:self];
596 // Hide away fields that cannot be edited. 596 // Hide away fields that cannot be edited.
597 if (kColumnSetId == -1) { 597 if (kColumnSetId == -1) {
598 [control setFrame:NSZeroRect]; 598 [control setFrame:NSZeroRect];
(...skipping 50 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

Powered by Google App Engine
This is Rietveld 408576698