Index: chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h |
diff --git a/chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h b/chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h |
index fd4df8bc52724fa4a13e26b8ba17d5db6cdad1d3..d0e09ab44845fbc595af475a6210fd5a82339bce 100644 |
--- a/chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h |
+++ b/chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h |
@@ -8,12 +8,15 @@ |
#import <Cocoa/Cocoa.h> |
#import "base/mac/scoped_nsobject.h" |
+#include "components/autofill/core/common/password_form.h" |
#include "components/password_manager/core/common/password_manager_ui.h" |
+#import "ui/base/cocoa/tracking_area.h" |
namespace autofill { |
struct PasswordForm; |
} // namespace autofill |
+@class HoverImageButton; |
class ManagePasswordsBubbleModel; |
// The state of the password item. |
@@ -23,6 +26,44 @@ enum ManagePasswordItemState { |
MANAGE_PASSWORD_ITEM_STATE_DELETED |
}; |
+// Abstract superclass for items that are clickable. Highlights on hover. |
+@interface ManagePasswordItemClickableView : NSView { |
+ @private |
+ BOOL hovering_; |
+ ui::ScopedCrTrackingArea trackingArea_; |
+} |
+@end |
+ |
+// Shows the option to undelete a password. |
+@interface ManagePasswordItemUndoView : ManagePasswordItemClickableView { |
+ @private |
+ base::scoped_nsobject<NSButton> undoButton_; |
+} |
+- (id)initWithTarget:(id)target action:(SEL)action; |
+@end |
+ |
+@interface ManagePasswordItemUndoView (Testing) |
+@property(readonly) NSButton* undoButton; |
+@end |
+ |
+// Shows a username, obscured password, and delete button in a single row. |
+@interface ManagePasswordItemManageView : ManagePasswordItemClickableView { |
+ @private |
+ base::scoped_nsobject<NSTextField> usernameField_; |
+ base::scoped_nsobject<NSSecureTextField> passwordField_; |
+ base::scoped_nsobject<HoverImageButton> deleteButton_; |
+} |
+- (id)initWithForm:(const autofill::PasswordForm&)form |
+ target:(id)target |
+ action:(SEL)action; |
+@end |
+ |
+@interface ManagePasswordItemManageView (Testing) |
+@property(readonly) NSTextField* usernameField; |
+@property(readonly) NSSecureTextField* passwordField; |
+@property(readonly) NSButton* deleteButton; |
+@end |
+ |
// Shows a username and obscured password in a single row. |
@interface ManagePasswordItemPendingView : NSView { |
@private |
@@ -42,19 +83,20 @@ enum ManagePasswordItemState { |
@interface ManagePasswordItemViewController : NSViewController { |
@private |
ManagePasswordsBubbleModel* model_; // weak |
+ autofill::PasswordForm passwordForm_; |
ManagePasswordItemState state_; |
password_manager::ui::PasswordItemPosition position_; |
base::scoped_nsobject<NSView> contentView_; |
- CGFloat minWidth_; |
} |
- (id)initWithModel:(ManagePasswordsBubbleModel*)model |
- position:(password_manager::ui::PasswordItemPosition)position |
- minWidth:(CGFloat)minWidth; |
+ passwordForm:(const autofill::PasswordForm&)passwordForm |
+ position:(password_manager::ui::PasswordItemPosition)position; |
@end |
@interface ManagePasswordItemViewController (Testing) |
@property(readonly) ManagePasswordItemState state; |
@property(readonly) NSView* contentView; |
+@property(readonly) autofill::PasswordForm passwordForm; |
@end |
#endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_ |