Chromium Code Reviews| 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_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/timer/elapsed_timer.h" | 9 #include "base/timer/elapsed_timer.h" |
| 10 #include "chrome/browser/ui/passwords/manage_passwords_state.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_state.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 | 73 |
| 74 // PasswordStore::Observer implementation. | 74 // PasswordStore::Observer implementation. |
| 75 void OnLoginsChanged( | 75 void OnLoginsChanged( |
| 76 const password_manager::PasswordStoreChangeList& changes) override; | 76 const password_manager::PasswordStoreChangeList& changes) override; |
| 77 | 77 |
| 78 // Called from the model when the user chooses to save a password; passes the | 78 // Called from the model when the user chooses to save a password; passes the |
| 79 // action off to the FormManager. The controller MUST be in a pending state, | 79 // action off to the FormManager. The controller MUST be in a pending state, |
| 80 // and WILL be in MANAGE_STATE after this method executes. | 80 // and WILL be in MANAGE_STATE after this method executes. |
| 81 virtual void SavePassword(); | 81 virtual void SavePassword(); |
| 82 | 82 |
| 83 // Called from the model when the user chooses to update a password; passes | |
| 84 // the action off to the FormManager. The controller MUST be in a pending | |
|
vabr (Chromium)
2015/06/03 16:33:26
nit: Pass off means "happen or be concluded in a s
dvadym
2015/06/19 15:27:29
I've copied it from lines 78-80. Those lines were
vabr (Chromium)
2015/06/19 18:03:16
So, what did you hear back? :)
dvadym
2015/07/23 09:45:43
I've removed "off" in SavePassword and UpdatePassw
| |
| 85 // state, and WILL be in MANAGE_STATE after this method executes. | |
| 86 virtual void UpdatePassword(const autofill::PasswordForm& password_form); | |
| 87 | |
| 83 // Called from the model when the user chooses a credential. | 88 // Called from the model when the user chooses a credential. |
| 84 // The controller MUST be in a pending credentials state. | 89 // The controller MUST be in a pending credentials state. |
| 85 virtual void ChooseCredential( | 90 virtual void ChooseCredential( |
| 86 const autofill::PasswordForm& form, | 91 const autofill::PasswordForm& form, |
| 87 password_manager::CredentialType credential_type); | 92 password_manager::CredentialType credential_type); |
| 88 | 93 |
| 89 // Called from the model when the user chooses to never save passwords; passes | 94 // Called from the model when the user chooses to never save passwords; passes |
| 90 // the action off to the FormManager. The controller MUST be in a pending | 95 // the action off to the FormManager. The controller MUST be in a pending |
| 91 // state, and WILL be in BLACKLIST_STATE after this method executes. | 96 // state, and WILL be in BLACKLIST_STATE after this method executes. |
| 92 virtual void NeverSavePassword(); | 97 virtual void NeverSavePassword(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 return passwords_data_.federated_credentials_forms(); | 149 return passwords_data_.federated_credentials_forms(); |
| 145 } | 150 } |
| 146 | 151 |
| 147 protected: | 152 protected: |
| 148 explicit ManagePasswordsUIController( | 153 explicit ManagePasswordsUIController( |
| 149 content::WebContents* web_contents); | 154 content::WebContents* web_contents); |
| 150 | 155 |
| 151 // The pieces of saving and blacklisting passwords that interact with | 156 // The pieces of saving and blacklisting passwords that interact with |
| 152 // FormManager, split off into internal functions for testing/mocking. | 157 // FormManager, split off into internal functions for testing/mocking. |
| 153 virtual void SavePasswordInternal(); | 158 virtual void SavePasswordInternal(); |
| 159 virtual void UpdatePasswordInternal( | |
|
vasilii
2015/06/03 18:32:02
The fact that this function exists means that you
dvadym
2015/06/19 15:27:29
Sure, I've just forgotten to indicate in test of C
| |
| 160 const autofill::PasswordForm& password_form); | |
| 154 virtual void NeverSavePasswordInternal(); | 161 virtual void NeverSavePasswordInternal(); |
| 155 | 162 |
| 156 // Called when a PasswordForm is autofilled, when a new PasswordForm is | 163 // Called when a PasswordForm is autofilled, when a new PasswordForm is |
| 157 // submitted, or when a navigation occurs to update the visibility of the | 164 // submitted, or when a navigation occurs to update the visibility of the |
| 158 // manage passwords icon and bubble. | 165 // manage passwords icon and bubble. |
| 159 virtual void UpdateBubbleAndIconVisibility(); | 166 virtual void UpdateBubbleAndIconVisibility(); |
| 160 | 167 |
| 161 // Returns the time elapsed since |timer_| was initialized, | 168 // Returns the time elapsed since |timer_| was initialized, |
| 162 // or base::TimeDelta::Max() if |timer_| was not initialized. | 169 // or base::TimeDelta::Max() if |timer_| was not initialized. |
| 163 virtual base::TimeDelta Elapsed() const; | 170 virtual base::TimeDelta Elapsed() const; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 scoped_ptr<base::ElapsedTimer> timer_; | 202 scoped_ptr<base::ElapsedTimer> timer_; |
| 196 | 203 |
| 197 // Contains true if the bubble is to be popped up in the next call to | 204 // Contains true if the bubble is to be popped up in the next call to |
| 198 // UpdateBubbleAndIconVisibility(). | 205 // UpdateBubbleAndIconVisibility(). |
| 199 bool should_pop_up_bubble_; | 206 bool should_pop_up_bubble_; |
| 200 | 207 |
| 201 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); | 208 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); |
| 202 }; | 209 }; |
| 203 | 210 |
| 204 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 211 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
| OLD | NEW |