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/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/timer/elapsed_timer.h" | 10 #include "base/timer/elapsed_timer.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 public password_manager::PasswordStore::Observer { | 30 public password_manager::PasswordStore::Observer { |
| 31 public: | 31 public: |
| 32 virtual ~ManagePasswordsUIController(); | 32 virtual ~ManagePasswordsUIController(); |
| 33 | 33 |
| 34 // Called when the user submits a form containing login information, so we | 34 // Called when the user submits a form containing login information, so we |
| 35 // can handle later requests to save or blacklist that login information. | 35 // can handle later requests to save or blacklist that login information. |
| 36 // This stores the provided object in form_manager_ and triggers the UI to | 36 // This stores the provided object in form_manager_ and triggers the UI to |
| 37 // prompt the user about whether they would like to save the password. | 37 // prompt the user about whether they would like to save the password. |
| 38 void OnPasswordSubmitted(password_manager::PasswordFormManager* form_manager); | 38 void OnPasswordSubmitted(password_manager::PasswordFormManager* form_manager); |
| 39 | 39 |
| 40 // Called when the password will be saved automatically, but we still wish to | |
| 41 // visually inform the user that the save has occured. Currently shows the | |
| 42 // manage password UI. | |
| 43 void ShowSaveConfirmation( | |
|
Garrett Casto
2014/07/16 06:29:00
I don't like the fact that this name is prescripti
Mike West
2014/07/16 07:55:03
"OnAutomaticPasswordSave"? Best I can come up with
Garrett Casto
2014/07/17 06:42:45
It'll do. Changed.
| |
| 44 scoped_ptr<password_manager::PasswordFormManager> form_manager); | |
| 45 | |
| 40 // Called when a form is autofilled with login information, so we can manage | 46 // Called when a form is autofilled with login information, so we can manage |
| 41 // password credentials for the current site which are stored in | 47 // password credentials for the current site which are stored in |
| 42 // |password_form_map|. This stores a copy of |password_form_map| and shows | 48 // |password_form_map|. This stores a copy of |password_form_map| and shows |
| 43 // the manage password icon. | 49 // the manage password icon. |
| 44 void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map); | 50 void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map); |
| 45 | 51 |
| 46 // Called when a form is _not_ autofilled due to user blacklisting. This | 52 // Called when a form is _not_ autofilled due to user blacklisting. This |
| 47 // stores a copy of |password_form_map| so that we can offer the user the | 53 // stores a copy of |password_form_map| so that we can offer the user the |
| 48 // ability to reenable the manager for this form. | 54 // ability to reenable the manager for this form. |
| 49 void OnBlacklistBlockedAutofill( | 55 void OnBlacklistBlockedAutofill( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 // The pieces of saving and blacklisting passwords that interact with | 102 // The pieces of saving and blacklisting passwords that interact with |
| 97 // FormManager, split off into internal functions for testing/mocking. | 103 // FormManager, split off into internal functions for testing/mocking. |
| 98 virtual void SavePasswordInternal(); | 104 virtual void SavePasswordInternal(); |
| 99 virtual void NeverSavePasswordInternal(); | 105 virtual void NeverSavePasswordInternal(); |
| 100 | 106 |
| 101 // content::WebContentsObserver: | 107 // content::WebContentsObserver: |
| 102 virtual void DidNavigateMainFrame( | 108 virtual void DidNavigateMainFrame( |
| 103 const content::LoadCommittedDetails& details, | 109 const content::LoadCommittedDetails& details, |
| 104 const content::FrameNavigateParams& params) OVERRIDE; | 110 const content::FrameNavigateParams& params) OVERRIDE; |
| 105 | 111 |
| 106 // All previously stored credentials for a specific site. Set by | 112 // All previously stored credentials for a specific site. This is not |
| 107 // OnPasswordSubmitted(), OnPasswordAutofilled(), or | 113 // physically const, but the contents of the maps should be treated as const. |
|
Mike West
2014/07/16 07:55:03
Would it be worth creating an `autofill::ConstPass
Garrett Casto
2014/07/17 06:42:45
I thought about that, but was wasn't sure how vira
| |
| 108 // OnBlacklistBlockedAutofill(). Protected, not private, so we can mess with | 114 // Protected, not private, so we can mess with the value in |
| 109 // the value in ManagePasswordsUIControllerMock. | 115 // ManagePasswordsUIControllerMock. |
| 110 autofill::PasswordFormMap password_form_map_; | 116 autofill::PasswordFormMap password_form_map_; |
| 111 | 117 |
| 112 // We create copies of PasswordForm objects that come in via OnLoginsChanged() | 118 // We create copies of PasswordForm objects that come in via OnLoginsChanged() |
| 113 // and store them in this vector as well as in |password_form_map_| to ensure | 119 // and store them in this vector as well as in |password_form_map_| to ensure |
| 114 // that we destroy them correctly. | 120 // that we destroy them correctly. |
| 115 ScopedVector<autofill::PasswordForm> new_password_forms_; | 121 ScopedVector<autofill::PasswordForm> new_password_forms_; |
| 116 | 122 |
| 117 // The current state of the password manager. Protected so we can manipulate | 123 // The current state of the password manager. Protected so we can manipulate |
| 118 // the value in tests. | 124 // the value in tests. |
| 119 password_manager::ui::State state_; | 125 password_manager::ui::State state_; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 150 | 156 |
| 151 // The origin of the form we're currently dealing with; we'll use this to | 157 // The origin of the form we're currently dealing with; we'll use this to |
| 152 // determine which PasswordStore changes we should care about when updating | 158 // determine which PasswordStore changes we should care about when updating |
| 153 // |password_form_map_|. | 159 // |password_form_map_|. |
| 154 GURL origin_; | 160 GURL origin_; |
| 155 | 161 |
| 156 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); | 162 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); |
| 157 }; | 163 }; |
| 158 | 164 |
| 159 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 165 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
| OLD | NEW |