OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" | 10 #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 namespace views { | 23 namespace views { |
24 class ImageView; | 24 class ImageView; |
25 class Label; | 25 class Label; |
26 } | 26 } |
27 | 27 |
28 // CredentialsItemView represents a credential view in the account chooser | 28 // CredentialsItemView represents a credential view in the account chooser |
29 // bubble. | 29 // bubble. |
30 class CredentialsItemView : public AccountAvatarFetcherDelegate, | 30 class CredentialsItemView : public AccountAvatarFetcherDelegate, |
31 public views::LabelButton { | 31 public views::LabelButton { |
32 public: | 32 public: |
| 33 enum Style { |
| 34 ACCOUNT_CHOOSER, |
| 35 AUTO_SIGNIN, |
| 36 }; |
| 37 |
33 CredentialsItemView(views::ButtonListener* button_listener, | 38 CredentialsItemView(views::ButtonListener* button_listener, |
34 const autofill::PasswordForm& form, | 39 const autofill::PasswordForm& form, |
35 password_manager::CredentialType credential_type, | 40 password_manager::CredentialType credential_type, |
| 41 Style style, |
36 net::URLRequestContextGetter* request_context); | 42 net::URLRequestContextGetter* request_context); |
37 ~CredentialsItemView() override; | 43 ~CredentialsItemView() override; |
38 | 44 |
39 const autofill::PasswordForm& form() const { return form_; } | 45 const autofill::PasswordForm& form() const { return form_; } |
40 password_manager::CredentialType credential_type() const { | 46 password_manager::CredentialType credential_type() const { |
41 return credential_type_; | 47 return credential_type_; |
42 } | 48 } |
43 | 49 |
44 // AccountAvatarFetcherDelegate: | 50 // AccountAvatarFetcherDelegate: |
45 void UpdateAvatar(const gfx::ImageSkia& image) override; | 51 void UpdateAvatar(const gfx::ImageSkia& image) override; |
(...skipping 10 matching lines...) Expand all Loading... |
56 views::ImageView* image_view_; | 62 views::ImageView* image_view_; |
57 views::Label* upper_label_; | 63 views::Label* upper_label_; |
58 views::Label* lower_label_; | 64 views::Label* lower_label_; |
59 | 65 |
60 base::WeakPtrFactory<CredentialsItemView> weak_ptr_factory_; | 66 base::WeakPtrFactory<CredentialsItemView> weak_ptr_factory_; |
61 | 67 |
62 DISALLOW_COPY_AND_ASSIGN(CredentialsItemView); | 68 DISALLOW_COPY_AND_ASSIGN(CredentialsItemView); |
63 }; | 69 }; |
64 | 70 |
65 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_ | 71 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_ |
OLD | NEW |