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_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" |
11 #include "components/infobars/core/confirm_infobar_delegate.h" | 11 #include "components/infobars/core/confirm_infobar_delegate.h" |
12 #include "components/password_manager/core/browser/password_form_manager.h" | 12 #include "components/password_manager/core/browser/password_form_manager.h" |
13 #include "components/password_manager/core/browser/password_manager_metrics_util .h" | 13 #include "components/password_manager/core/browser/password_manager_metrics_util .h" |
14 #include "ui/gfx/range/range.h" | |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 class WebContents; | 17 class WebContents; |
17 } | 18 } |
18 | 19 |
19 namespace password_manager { | 20 namespace password_manager { |
20 enum class CredentialSourceType; | 21 enum class CredentialSourceType; |
21 } | 22 } |
22 | 23 |
23 // After a successful *new* login attempt, we take the PasswordFormManager in | 24 // After a successful *new* login attempt, we take the PasswordFormManager in |
(...skipping 15 matching lines...) Expand all Loading... | |
39 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 40 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
40 const std::string& uma_histogram_suffix, | 41 const std::string& uma_histogram_suffix, |
41 password_manager::CredentialSourceType source_type); | 42 password_manager::CredentialSourceType source_type); |
42 | 43 |
43 ~SavePasswordInfoBarDelegate() override; | 44 ~SavePasswordInfoBarDelegate() override; |
44 | 45 |
45 // If the infobar was triggered by the Credential management API, then on | 46 // If the infobar was triggered by the Credential management API, then on |
46 // Android it should display the "More" button. | 47 // Android it should display the "More" button. |
47 bool ShouldShowMoreButton(); | 48 bool ShouldShowMoreButton(); |
48 | 49 |
50 const gfx::Range& title_link_range() const { return title_link_range_; } | |
51 | |
49 // ConfirmInfoBarDelegate: | 52 // ConfirmInfoBarDelegate: |
50 Type GetInfoBarType() const override; | 53 Type GetInfoBarType() const override; |
51 InfoBarAutomationType GetInfoBarAutomationType() const override; | 54 InfoBarAutomationType GetInfoBarAutomationType() const override; |
52 int GetIconID() const override; | 55 int GetIconID() const override; |
53 bool ShouldExpire(const NavigationDetails& details) const override; | 56 bool ShouldExpire(const NavigationDetails& details) const override; |
54 void InfoBarDismissed() override; | 57 void InfoBarDismissed() override; |
55 base::string16 GetMessageText() const override; | 58 base::string16 GetMessageText() const override; |
56 base::string16 GetButtonLabel(InfoBarButton button) const override; | 59 base::string16 GetButtonLabel(InfoBarButton button) const override; |
60 bool LinkClicked(WindowOpenDisposition disposition) override; | |
57 bool Accept() override; | 61 bool Accept() override; |
58 bool Cancel() override; | 62 bool Cancel() override; |
59 | 63 |
60 protected: | 64 protected: |
61 // Makes a ctor available in tests. | 65 // Makes a ctor available in tests. |
62 SavePasswordInfoBarDelegate( | 66 SavePasswordInfoBarDelegate( |
63 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 67 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
64 const std::string& uma_histogram_suffix, | 68 const std::string& uma_histogram_suffix, |
65 password_manager::CredentialSourceType source_type, | 69 password_manager::CredentialSourceType source_type, |
66 bool is_smartlock_branding_enabled); | 70 bool is_smartlock_branding_enabled); |
(...skipping 14 matching lines...) Expand all Loading... | |
81 // form is on a monitored domain. Otherwise, an empty string. | 85 // form is on a monitored domain. Otherwise, an empty string. |
82 const std::string uma_histogram_suffix_; | 86 const std::string uma_histogram_suffix_; |
83 | 87 |
84 // Records source from where infobar was triggered. | 88 // Records source from where infobar was triggered. |
85 // Infobar appearance (title, buttons) depends on value of this parameter. | 89 // Infobar appearance (title, buttons) depends on value of this parameter. |
86 password_manager::CredentialSourceType source_type_; | 90 password_manager::CredentialSourceType source_type_; |
87 | 91 |
88 // Title for the infobar: branded as a part of Google Smart Lock for signed | 92 // Title for the infobar: branded as a part of Google Smart Lock for signed |
89 // users. | 93 // users. |
90 base::string16 title_; | 94 base::string16 title_; |
95 // If title contains Google Smart Lock, then it should be link to help center | |
gone
2015/05/13 18:33:25
nit: add blank line above
Maybe:
If set, describe
melandory
2015/05/13 22:30:04
Definitely better. Thanks for suggested improvemen
| |
96 // article. | |
97 gfx::Range title_link_range_; | |
91 | 98 |
92 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); | 99 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
93 }; | 100 }; |
94 | 101 |
95 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 102 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
OLD | NEW |