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

Unified Diff: chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h

Issue 438893002: Add ManagePasswordItemViewController and unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix constants in test Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..fd4df8bc52724fa4a13e26b8ba17d5db6cdad1d3
--- /dev/null
+++ b/chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.h
@@ -0,0 +1,60 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_
+#define CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#import "base/mac/scoped_nsobject.h"
+#include "components/password_manager/core/common/password_manager_ui.h"
+
+namespace autofill {
+struct PasswordForm;
+} // namespace autofill
+
+class ManagePasswordsBubbleModel;
+
+// The state of the password item.
+enum ManagePasswordItemState {
+ MANAGE_PASSWORD_ITEM_STATE_PENDING,
+ MANAGE_PASSWORD_ITEM_STATE_MANAGE,
+ MANAGE_PASSWORD_ITEM_STATE_DELETED
+};
+
+// Shows a username and obscured password in a single row.
+@interface ManagePasswordItemPendingView : NSView {
+ @private
+ base::scoped_nsobject<NSTextField> usernameField_;
+ base::scoped_nsobject<NSSecureTextField> passwordField_;
+}
+- (id)initWithForm:(const autofill::PasswordForm&)form;
+@end
+
+@interface ManagePasswordItemPendingView (Testing)
+@property(readonly) NSTextField* usernameField;
+@property(readonly) NSSecureTextField* passwordField;
+@end
+
+// Shows a single item in a password management list. Transitions between
+// PENDING, MANAGE, and DELETED states according to user interaction.
+@interface ManagePasswordItemViewController : NSViewController {
+ @private
+ ManagePasswordsBubbleModel* model_; // weak
+ 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;
+@end
+
+@interface ManagePasswordItemViewController (Testing)
+@property(readonly) ManagePasswordItemState state;
+@property(readonly) NSView* contentView;
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_CONTROLLER_H_
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/passwords/manage_password_item_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698