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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 for (it = detailInputs_.begin(); it < detailInputs_.end(); ++it) { | 591 for (it = detailInputs_.begin(); it < detailInputs_.end(); ++it) { |
592 std::vector<const autofill::DetailInput*>::iterator start = it; | 592 std::vector<const autofill::DetailInput*>::iterator start = it; |
593 while (it != detailInputs_.end() && | 593 while (it != detailInputs_.end() && |
594 (*it)->length != autofill::DetailInput::LONG) { | 594 (*it)->length != autofill::DetailInput::LONG) { |
595 ++it; | 595 ++it; |
596 } | 596 } |
597 std::reverse(start, it); | 597 std::reverse(start, it); |
598 } | 598 } |
599 | 599 |
600 base::scoped_nsobject<LayoutView> view([[LayoutView alloc] init]); | 600 base::scoped_nsobject<LayoutView> view([[LayoutView alloc] init]); |
601 [view setLayoutManager: | 601 [view setLayoutManager:std::unique_ptr<SimpleGridLayout>( |
602 scoped_ptr<SimpleGridLayout>(new SimpleGridLayout(view))]; | 602 new SimpleGridLayout(view))]; |
603 SimpleGridLayout* layout = [view layoutManager]; | 603 SimpleGridLayout* layout = [view layoutManager]; |
604 | 604 |
605 int column_set_id = 0; | 605 int column_set_id = 0; |
606 for (size_t i = 0; i < detailInputs_.size(); ++i) { | 606 for (size_t i = 0; i < detailInputs_.size(); ++i) { |
607 const autofill::DetailInput& input = *detailInputs_[i]; | 607 const autofill::DetailInput& input = *detailInputs_[i]; |
608 | 608 |
609 if (input.length == autofill::DetailInput::LONG) | 609 if (input.length == autofill::DetailInput::LONG) |
610 ++column_set_id; | 610 ++column_set_id; |
611 | 611 |
612 int kColumnSetId = | 612 int kColumnSetId = |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 | 750 |
751 - (void)activateFieldForType:(autofill::ServerFieldType)type { | 751 - (void)activateFieldForType:(autofill::ServerFieldType)type { |
752 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:type]; | 752 NSControl<AutofillInputField>* field = [inputs_ viewWithTag:type]; |
753 if (field) { | 753 if (field) { |
754 [[field window] makeFirstResponder:field]; | 754 [[field window] makeFirstResponder:field]; |
755 [self fieldEditedOrActivated:field edited:NO]; | 755 [self fieldEditedOrActivated:field edited:NO]; |
756 } | 756 } |
757 } | 757 } |
758 | 758 |
759 @end | 759 @end |
OLD | NEW |