| OLD | NEW |
| 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 #include "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h" | 5 #include "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/ios/ios_util.h" | 8 #include "base/ios/ios_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 [_verifyButton setTitleTextAttributes:@{ | 199 [_verifyButton setTitleTextAttributes:@{ |
| 200 NSForegroundColorAttributeName : [UIColor lightGrayColor] | 200 NSForegroundColorAttributeName : [UIColor lightGrayColor] |
| 201 } | 201 } |
| 202 forState:UIControlStateDisabled]; | 202 forState:UIControlStateDisabled]; |
| 203 [_verifyButton setEnabled:NO]; | 203 [_verifyButton setEnabled:NO]; |
| 204 self.navigationItem.rightBarButtonItem = _verifyButton; | 204 self.navigationItem.rightBarButtonItem = _verifyButton; |
| 205 } | 205 } |
| 206 | 206 |
| 207 - (void)viewWillLayoutSubviews { | 207 - (void)viewWillLayoutSubviews { |
| 208 [super viewWillLayoutSubviews]; | 208 [super viewWillLayoutSubviews]; |
| 209 NSIndexPath* CVCIndexPath = | 209 if ([self.collectionViewModel hasItemForItemType:ItemTypeCVC |
| 210 [self.collectionViewModel indexPathForItem:_CVCItem]; | 210 sectionIdentifier:SectionIdentifierMain]) { |
| 211 CVCCell* CVC = base::mac::ObjCCastStrict<CVCCell>( | 211 NSIndexPath* CVCIndexPath = |
| 212 [self.collectionView cellForItemAtIndexPath:CVCIndexPath]); | 212 [self.collectionViewModel indexPathForItem:_CVCItem]; |
| 213 [self focusInputIfNeeded:CVC]; | 213 CVCCell* CVC = base::mac::ObjCCastStrict<CVCCell>( |
| 214 [self.collectionView cellForItemAtIndexPath:CVCIndexPath]); |
| 215 [self focusInputIfNeeded:CVC]; |
| 216 } |
| 214 } | 217 } |
| 215 | 218 |
| 216 #pragma mark - CollectionViewController | 219 #pragma mark - CollectionViewController |
| 217 | 220 |
| 218 - (void)loadModel { | 221 - (void)loadModel { |
| 219 [super loadModel]; | 222 [super loadModel]; |
| 220 CollectionViewModel* model = self.collectionViewModel; | 223 CollectionViewModel* model = self.collectionViewModel; |
| 221 [model addSectionWithIdentifier:SectionIdentifierMain]; | 224 [model addSectionWithIdentifier:SectionIdentifierMain]; |
| 222 | 225 |
| 223 autofill::CardUnmaskPromptController* controller = _bridge->GetController(); | 226 autofill::CardUnmaskPromptController* controller = _bridge->GetController(); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 - (void)collectionView:(UICollectionView*)collectionView | 592 - (void)collectionView:(UICollectionView*)collectionView |
| 590 willDisplayCell:(UICollectionViewCell*)cell | 593 willDisplayCell:(UICollectionViewCell*)cell |
| 591 forItemAtIndexPath:(NSIndexPath*)indexPath { | 594 forItemAtIndexPath:(NSIndexPath*)indexPath { |
| 592 CVCCell* CVC = base::mac::ObjCCast<CVCCell>(cell); | 595 CVCCell* CVC = base::mac::ObjCCast<CVCCell>(cell); |
| 593 if (CVC) { | 596 if (CVC) { |
| 594 [self focusInputIfNeeded:CVC]; | 597 [self focusInputIfNeeded:CVC]; |
| 595 } | 598 } |
| 596 } | 599 } |
| 597 | 600 |
| 598 @end | 601 @end |
| OLD | NEW |