Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "components/password_manager/core/browser/password_form_manager.h" | 8 #include "components/password_manager/core/browser/password_form_manager.h" |
| 9 #include "content/public/browser/navigation_details.h" | 9 #include "content/public/browser/navigation_details.h" |
| 10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 // Called when a form is _not_ autofilled due to user blacklisting. | 36 // Called when a form is _not_ autofilled due to user blacklisting. |
| 37 void OnBlacklistBlockedAutofill(); | 37 void OnBlacklistBlockedAutofill(); |
| 38 | 38 |
| 39 // TODO(npentrel) This ought to be changed. Best matches should be newly | 39 // TODO(npentrel) This ought to be changed. Best matches should be newly |
| 40 // made when opening the ManagePasswordsBubble because there may have been | 40 // made when opening the ManagePasswordsBubble because there may have been |
| 41 // changes to the best matches via the settings page. At the moment this also | 41 // changes to the best matches via the settings page. At the moment this also |
| 42 // fails if one deletes a password when they are autofilled, as it still shows | 42 // fails if one deletes a password when they are autofilled, as it still shows |
| 43 // up after logging in and saving a password. | 43 // up after logging in and saving a password. |
| 44 void RemoveFromBestMatches(autofill::PasswordForm password_form); | 44 void RemoveFromBestMatches(autofill::PasswordForm password_form); |
| 45 | 45 |
| 46 void SavePassword(); | 46 // Called from the model when the user chooses to save a password; passes the |
| 47 // action off to the FormManager. | |
| 48 virtual void SavePassword(); | |
| 47 | 49 |
| 48 void NeverSavePassword(); | 50 // Called from the model when the user chooses to never save passwords; passes |
| 51 // the action off to the FormManager. | |
| 52 virtual void NeverSavePassword(); | |
| 49 | 53 |
| 50 // Called when the bubble is opened after the icon gets displayed. We change | 54 // Called when the bubble is opened after the icon gets displayed. We change |
| 51 // the state to know that we do not need to pop up the bubble again. | 55 // the state to know that we do not need to pop up the bubble again. |
| 52 void OnBubbleShown(); | 56 void OnBubbleShown(); |
| 53 | 57 |
| 58 // Open a new tab, pointing to the password manager settings page. | |
| 59 virtual void NavigateToPasswordManagerSettingsPage(); | |
| 60 | |
| 54 bool manage_passwords_icon_to_be_shown() const { | 61 bool manage_passwords_icon_to_be_shown() const { |
| 55 return manage_passwords_icon_to_be_shown_; | 62 return manage_passwords_icon_to_be_shown_; |
| 56 } | 63 } |
| 57 | 64 |
| 58 bool password_to_be_saved() const { | 65 bool password_to_be_saved() const { |
| 59 return password_to_be_saved_; | 66 return password_to_be_saved_; |
| 60 } | 67 } |
| 61 | 68 |
| 62 bool manage_passwords_bubble_needs_showing() const { | 69 bool manage_passwords_bubble_needs_showing() const { |
| 63 return manage_passwords_bubble_needs_showing_; | 70 return manage_passwords_bubble_needs_showing_; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 87 password_submitted_ = password_submitted; | 94 password_submitted_ = password_submitted; |
| 88 } | 95 } |
| 89 | 96 |
| 90 bool autofill_blocked() const { return autofill_blocked_; } | 97 bool autofill_blocked() const { return autofill_blocked_; } |
| 91 void set_autofill_blocked(bool autofill_blocked) { | 98 void set_autofill_blocked(bool autofill_blocked) { |
| 92 autofill_blocked_ = autofill_blocked; | 99 autofill_blocked_ = autofill_blocked; |
| 93 } | 100 } |
| 94 | 101 |
| 95 private: | 102 private: |
| 96 friend class content::WebContentsUserData<ManagePasswordsBubbleUIController>; | 103 friend class content::WebContentsUserData<ManagePasswordsBubbleUIController>; |
| 104 friend class TestManagePasswordsBubbleUIController; | |
|
vabr (Chromium)
2014/04/10 12:35:14
This does not seem right. TestManagePasswordsBubbl
Mike West
2014/04/10 12:46:43
You're right, of course. Not sure what I was think
| |
| 97 | 105 |
| 98 explicit ManagePasswordsBubbleUIController( | 106 explicit ManagePasswordsBubbleUIController( |
| 99 content::WebContents* web_contents); | 107 content::WebContents* web_contents); |
| 100 | 108 |
| 101 // Called when a passwordform is autofilled, when a new passwordform is | 109 // Called when a passwordform is autofilled, when a new passwordform is |
| 102 // submitted, or when a navigation occurs to update the visibility of the | 110 // submitted, or when a navigation occurs to update the visibility of the |
| 103 // manage passwords icon and bubble. | 111 // manage passwords icon and bubble. |
| 104 void UpdateBubbleAndIconVisibility(); | 112 void UpdateBubbleAndIconVisibility(); |
| 105 | 113 |
| 106 // content::WebContentsObserver: | 114 // content::WebContentsObserver: |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 126 bool password_submitted_; | 134 bool password_submitted_; |
| 127 | 135 |
| 128 // Stores whether autofill was blocked due to a user's decision to blacklist | 136 // Stores whether autofill was blocked due to a user's decision to blacklist |
| 129 // the current site ("Never save passwords for this site"). | 137 // the current site ("Never save passwords for this site"). |
| 130 bool autofill_blocked_; | 138 bool autofill_blocked_; |
| 131 | 139 |
| 132 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleUIController); | 140 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleUIController); |
| 133 }; | 141 }; |
| 134 | 142 |
| 135 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ | 143 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_UI_CONTROLLER_H_ |
| OLD | NEW |