Revert "Only store leading 13 bits of password hash."
[chromium-blink-merge.git] / chrome / browser / ui / views / passwords / credentials_item_view.h
blob01055701d17ce7c3eff925746ad5877aee9f914c
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_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/autofill/core/common/password_form.h"
11 #include "components/password_manager/content/common/credential_manager_types.h"
12 #include "ui/views/controls/button/label_button.h"
14 namespace gfx {
15 class ImageSkia;
18 namespace net {
19 class URLRequestContextGetter;
22 namespace views {
23 class ImageView;
24 class Label;
27 // CredentialsItemView represents a credential view in the account chooser
28 // bubble.
29 class CredentialsItemView : public views::LabelButton {
30 public:
31 CredentialsItemView(views::ButtonListener* button_listener,
32 const autofill::PasswordForm& form,
33 password_manager::CredentialType credential_type,
34 net::URLRequestContextGetter* request_context);
35 ~CredentialsItemView() override;
37 const autofill::PasswordForm& form() const { return form_; }
38 password_manager::CredentialType credential_type() const {
39 return credential_type_;
42 private:
43 class AvatarFetcher;
45 // views::LabelButton:
46 gfx::Size GetPreferredSize() const override;
47 int GetHeightForWidth(int w) const override;
48 void Layout() override;
50 void UpdateAvatar(const gfx::ImageSkia& image);
52 autofill::PasswordForm form_;
53 password_manager::CredentialType credential_type_;
55 views::ImageView* image_view_;
56 views::Label* full_name_label_;
57 views::Label* username_label_;
59 base::WeakPtrFactory<CredentialsItemView> weak_ptr_factory_;
61 DISALLOW_COPY_AND_ASSIGN(CredentialsItemView);
64 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_CREDENTIALS_ITEM_VIEW_H_