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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/credential_item_view.h

Issue 878743007: Implement CredentialItemView and tests for the Mac account chooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix order Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/passwords/credential_item_view.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_CREDENTIAL_ITEM_VIEW_H_
6 #define CHROME_BROWSER_UI_COCOA_PASSWORDS_CREDENTIAL_ITEM_VIEW_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #import "base/mac/scoped_nsobject.h"
11 #include "components/autofill/core/common/password_form.h"
12 #include "components/password_manager/content/common/credential_manager_types.h"
13
14 class GURL;
15
16 @class CredentialItemView;
groby-ooo-7-16 2015/03/03 17:34:33 We usually combine class/@class forward decls into
dconnelly 2015/03/04 12:30:54 Done.
17
18 // Handles user interaction with and image fetching for a CredentialItemView.
19 @protocol CredentialItemDelegate<NSObject>
20
21 // Retrieves the image located at |avatarURL| and updates |view| by calling
22 // [CredentialItemView updateAvatar:] if successful.
23 - (void)fetchAvatar:(const GURL&)avatarURL forView:(CredentialItemView*)view;
24
25 @end
26
27 // A view to show a single account credential.
28 @interface CredentialItemView : NSView {
29 autofill::PasswordForm passwordForm_;
30 password_manager::CredentialType credentialType_;
31 base::scoped_nsobject<NSTextField> nameLabel_;
groby-ooo-7-16 2015/03/03 17:34:33 Do we want to refcount here? (I know, I contradict
dconnelly 2015/03/04 12:30:54 I've removed the scoping to match the other review
groby-ooo-7-16 2015/03/04 16:17:59 Well, they're not entirely free :) I don't have a
32 base::scoped_nsobject<NSTextField> usernameLabel_;
33 base::scoped_nsobject<NSImageView> avatarView_;
34 id<CredentialItemDelegate> delegate_;
groby-ooo-7-16 2015/03/03 17:34:33 Do you want scoped_nsprotocol here? (I.e. do we wa
dconnelly 2015/03/04 12:30:54 ManagePasswordsBubbleAccountChooserViewController,
groby-ooo-7-16 2015/03/04 16:17:59 Acknowledged.
35 }
36
37 @property(nonatomic, readonly) autofill::PasswordForm passwordForm;
38 @property(nonatomic, readonly) password_manager::CredentialType credentialType;
39
40 // Initializes an item view populated with the data in |passwordForm|. Uses
41 // |delegate| to asynchronously fetch the avatar image.
42 - (id)initWithPasswordForm:(const autofill::PasswordForm&)passwordForm
43 credentialType:(password_manager::CredentialType)credentialType
44 delegate:(id<CredentialItemDelegate>)delegate;
45
46 // Sets a custom avatar for this item. The image should be scaled and cropped
47 // to a circle of size |kAvatarImageSize|, otherwise it will look ridiculous.
48 - (void)updateAvatar:(NSImage*)avatar;
49
50 // The default avatar image, used when a custom one is not set.
51 + (NSImage*)defaultAvatar;
52
53 @end
54
55 #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_CREDENTIAL_ITEM_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/passwords/credential_item_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698