1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 #import "base/mac/scoped_nsobject.h"
11 #include "components/password_manager/core/common/password_manager_ui.h"
15 } // namespace autofill
17 class ManagePasswordsBubbleModel;
19 // The state of the password item.
20 enum ManagePasswordItemState {
21 MANAGE_PASSWORD_ITEM_STATE_PENDING,
22 MANAGE_PASSWORD_ITEM_STATE_MANAGE,
23 MANAGE_PASSWORD_ITEM_STATE_DELETED
26 // Shows a username and obscured password in a single row.
27 @interface ManagePasswordItemPendingView : NSView {
29 base::scoped_nsobject<NSTextField> usernameField_;
30 base::scoped_nsobject<NSSecureTextField> passwordField_;
32 - (id)initWithForm:(const autofill::PasswordForm&)form;
35 @interface ManagePasswordItemPendingView (Testing)
36 @property(readonly) NSTextField* usernameField;
37 @property(readonly) NSSecureTextField* passwordField;
40 // Shows a single item in a password management list. Transitions between
41 // PENDING, MANAGE, and DELETED states according to user interaction.
42 @interface ManagePasswordItemViewController : NSViewController {
44 ManagePasswordsBubbleModel* model_; // weak
45 ManagePasswordItemState state_;
46 password_manager::ui::PasswordItemPosition position_;
47 base::scoped_nsobject<NSView> contentView_;
50 - (id)initWithModel:(ManagePasswordsBubbleModel*)model
51 position:(password_manager::ui::PasswordItemPosition)position
52 minWidth:(CGFloat)minWidth;
55 @interface ManagePasswordItemViewController (Testing)
56 @property(readonly) ManagePasswordItemState state;
57 @property(readonly) NSView* contentView;
60 #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_