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

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

Issue 2846253002: Add EGTests for passwords settings on iOS (Closed)
Patch Set: Comments 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/password_details_collection_view_control ler.h" 5 #import "ios/chrome/browser/ui/settings/password_details_collection_view_control ler.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/common/password_form.h" 9 #include "components/autofill/core/common/password_form.h"
10 #include "components/password_manager/core/browser/affiliation_utils.h" 10 #include "components/password_manager/core/browser/affiliation_utils.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 }; 287 };
288 [_weakReauthenticationModule 288 [_weakReauthenticationModule
289 attemptReauthWithLocalizedReason: 289 attemptReauthWithLocalizedReason:
290 l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_REAUTH_REASON_COPY) 290 l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_REAUTH_REASON_COPY)
291 handler:copyPasswordHandler]; 291 handler:copyPasswordHandler];
292 } 292 }
293 } 293 }
294 294
295 - (void)showCopyPasswordResultToast:(NSString*)message { 295 - (void)showCopyPasswordResultToast:(NSString*)message {
296 // TODO(crbug.com/159166): Route this through some delegate API to be able
297 // to mock it in the unittest, and avoid having an EGTest just for that?
296 MDCSnackbarMessage* copyPasswordResultMessage = 298 MDCSnackbarMessage* copyPasswordResultMessage =
297 [MDCSnackbarMessage messageWithText:message]; 299 [MDCSnackbarMessage messageWithText:message];
298 [MDCSnackbarManager showMessage:copyPasswordResultMessage]; 300 [MDCSnackbarManager showMessage:copyPasswordResultMessage];
299 } 301 }
300 302
301 - (void)deletePassword { 303 - (void)deletePassword {
302 [_weakDelegate deletePassword:_passwordForm]; 304 [_weakDelegate deletePassword:_passwordForm];
303 } 305 }
304 306
305 #pragma mark - UICollectionViewDelegate 307 #pragma mark - UICollectionViewDelegate
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 case ItemTypeUsername: 340 case ItemTypeUsername:
339 case ItemTypePassword: 341 case ItemTypePassword:
340 return [MDCCollectionViewCell 342 return [MDCCollectionViewCell
341 cr_preferredHeightForWidth:CGRectGetWidth(collectionView.bounds) 343 cr_preferredHeightForWidth:CGRectGetWidth(collectionView.bounds)
342 forItem:item]; 344 forItem:item];
343 default: 345 default:
344 return MDCCellDefaultOneLineHeight; 346 return MDCCellDefaultOneLineHeight;
345 } 347 }
346 } 348 }
347 349
350 #pragma mark - ForTesting
351
352 - (void)setReauthenticationModule:
353 (id<ReauthenticationProtocol>)reauthenticationModule {
354 _weakReauthenticationModule = reauthenticationModule;
355 }
356
348 @end 357 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698