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

Side by Side Diff: chrome/browser/password_manager/save_password_infobar_delegate.h

Issue 1134863002: [Smart Lock] Smart Lock branding in save password infobar available only for signed users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
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_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/timer/elapsed_timer.h" 10 #include "base/timer/elapsed_timer.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 bool ShouldExpire(const NavigationDetails& details) const override; 53 bool ShouldExpire(const NavigationDetails& details) const override;
54 void InfoBarDismissed() override; 54 void InfoBarDismissed() override;
55 base::string16 GetMessageText() const override; 55 base::string16 GetMessageText() const override;
56 base::string16 GetButtonLabel(InfoBarButton button) const override; 56 base::string16 GetButtonLabel(InfoBarButton button) const override;
57 bool Accept() override; 57 bool Accept() override;
58 bool Cancel() override; 58 bool Cancel() override;
59 59
60 protected: 60 protected:
61 // Makes a ctor available in tests. 61 // Makes a ctor available in tests.
62 SavePasswordInfoBarDelegate( 62 SavePasswordInfoBarDelegate(
63 content::WebContents* web_contents,
Mike West 2015/05/11 15:51:48 Nit: Could you pass in the profile instead? Or per
melandory 2015/05/12 09:07:23 Done.
63 scoped_ptr<password_manager::PasswordFormManager> form_to_save, 64 scoped_ptr<password_manager::PasswordFormManager> form_to_save,
64 const std::string& uma_histogram_suffix, 65 const std::string& uma_histogram_suffix,
65 password_manager::CredentialSourceType source_type); 66 password_manager::CredentialSourceType source_type);
66 67
67 private: 68 private:
68 // The PasswordFormManager managing the form we're asking the user about, 69 // The PasswordFormManager managing the form we're asking the user about,
69 // and should update as per her decision. 70 // and should update as per her decision.
70 scoped_ptr<password_manager::PasswordFormManager> form_to_save_; 71 scoped_ptr<password_manager::PasswordFormManager> form_to_save_;
71 72
72 // Used to track the results we get from the info bar. 73 // Used to track the results we get from the info bar.
73 password_manager::metrics_util::ResponseType infobar_response_; 74 password_manager::metrics_util::ResponseType infobar_response_;
74 75
75 // Measures the "Save password?" prompt lifetime. Used to report an UMA 76 // Measures the "Save password?" prompt lifetime. Used to report an UMA
76 // signal. 77 // signal.
77 base::ElapsedTimer timer_; 78 base::ElapsedTimer timer_;
78 79
79 // The group name corresponding to the domain name of |form_to_save_| if the 80 // The group name corresponding to the domain name of |form_to_save_| if the
80 // form is on a monitored domain. Otherwise, an empty string. 81 // form is on a monitored domain. Otherwise, an empty string.
81 const std::string uma_histogram_suffix_; 82 const std::string uma_histogram_suffix_;
82 83
83 // Records source from where infobar was triggered. 84 // Records source from where infobar was triggered.
84 // Infobar appearance (title, buttons) depends on value of this parameter. 85 // Infobar appearance (title, buttons) depends on value of this parameter.
85 password_manager::CredentialSourceType source_type_; 86 password_manager::CredentialSourceType source_type_;
86 87
88 // TODO(melandory): This member can be removed if we enable Smart Lock for
89 // non-signed in users.
90 content::WebContents* web_contents_;
91
87 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); 92 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate);
88 }; 93 };
89 94
90 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ 95 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698