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

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

Issue 1128073003: [Smart Lock] Make link from brading string (Google Smart Lock) in save password infobar. (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"
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
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 15 matching lines...) Expand all
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_;
91 95
96 // If set, describes the location of the link to the help center article for
97 // Smart Lock.
98 gfx::Range title_link_range_;
99
92 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); 100 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate);
93 }; 101 };
94 102
95 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ 103 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698