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

Side by Side Diff: ios/chrome/browser/ui/settings/autofill_profile_edit_collection_view_controller.mm

Issue 2761263003: Allow CollectionViewModel/Controller queries without SectionIdentifier (Closed)
Patch Set: Cleanup Created 3 years, 7 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/ui/settings/autofill_profile_edit_collection_view_co ntroller.h" 5 #import "ios/chrome/browser/ui/settings/autofill_profile_edit_collection_view_co ntroller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "components/autofill/core/browser/autofill_profile.h" 9 #include "components/autofill/core/browser/autofill_profile.h"
10 #include "components/autofill/core/browser/field_types.h" 10 #include "components/autofill/core/browser/field_types.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 _personalDataManager->UpdateProfile(_autofillProfile); 164 _personalDataManager->UpdateProfile(_autofillProfile);
165 } 165 }
166 166
167 // Reload the model. 167 // Reload the model.
168 [self loadModel]; 168 [self loadModel];
169 // Update the cells. 169 // Update the cells.
170 [self reconfigureCellsForItems: 170 [self reconfigureCellsForItems:
171 [self.collectionViewModel 171 [self.collectionViewModel
172 itemsInSectionWithIdentifier:SectionIdentifierFields] 172 itemsInSectionWithIdentifier:SectionIdentifierFields]];
173 inSectionWithIdentifier:SectionIdentifierFields];
174 } 173 }
175 174
176 - (void)loadModel { 175 - (void)loadModel {
177 [super loadModel]; 176 [super loadModel];
178 CollectionViewModel* model = self.collectionViewModel; 177 CollectionViewModel* model = self.collectionViewModel;
179 178
180 std::string locale = GetApplicationContext()->GetApplicationLocale(); 179 std::string locale = GetApplicationContext()->GetApplicationLocale();
181 [model addSectionWithIdentifier:SectionIdentifierFields]; 180 [model addSectionWithIdentifier:SectionIdentifierFields];
182 for (size_t i = 0; i < arraysize(kFieldsToDisplay); ++i) { 181 for (size_t i = 0; i < arraysize(kFieldsToDisplay); ++i) {
183 const AutofillFieldDisplayInfo& field = kFieldsToDisplay[i]; 182 const AutofillFieldDisplayInfo& field = kFieldsToDisplay[i];
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 [self.collectionView cellForItemAtIndexPath:indexPath]; 235 [self.collectionView cellForItemAtIndexPath:indexPath];
237 AutofillEditCell* textFieldCell = 236 AutofillEditCell* textFieldCell =
238 base::mac::ObjCCastStrict<AutofillEditCell>(cell); 237 base::mac::ObjCCastStrict<AutofillEditCell>(cell);
239 [textFieldCell.textField becomeFirstResponder]; 238 [textFieldCell.textField becomeFirstResponder];
240 } 239 }
241 return [super collectionView:collectionView 240 return [super collectionView:collectionView
242 shouldSelectItemAtIndexPath:indexPath]; 241 shouldSelectItemAtIndexPath:indexPath];
243 } 242 }
244 243
245 @end 244 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698