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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // The pieces of saving and blacklisting passwords that interact with | 107 // The pieces of saving and blacklisting passwords that interact with |
108 // FormManager, split off into internal functions for testing/mocking. | 108 // FormManager, split off into internal functions for testing/mocking. |
109 virtual void SavePasswordInternal(); | 109 virtual void SavePasswordInternal(); |
110 virtual void NeverSavePasswordInternal(); | 110 virtual void NeverSavePasswordInternal(); |
111 | 111 |
112 // content::WebContentsObserver: | 112 // content::WebContentsObserver: |
113 virtual void DidNavigateMainFrame( | 113 virtual void DidNavigateMainFrame( |
114 const content::LoadCommittedDetails& details, | 114 const content::LoadCommittedDetails& details, |
115 const content::FrameNavigateParams& params) OVERRIDE; | 115 const content::FrameNavigateParams& params) OVERRIDE; |
116 | 116 |
| 117 // We create copies of PasswordForm objects that come in with unclear lifetime |
| 118 // and store them in this vector as well as in |password_form_map_| to ensure |
| 119 // that we destroy them correctly. If |new_password_forms_| gets cleared then |
| 120 // |password_form_map_| is to be cleared too. |
| 121 ScopedVector<autofill::PasswordForm> new_password_forms_; |
| 122 |
117 // All previously stored credentials for a specific site. | 123 // All previously stored credentials for a specific site. |
118 // Protected, not private, so we can mess with the value in | 124 // Protected, not private, so we can mess with the value in |
119 // ManagePasswordsUIControllerMock. | 125 // ManagePasswordsUIControllerMock. |
120 autofill::ConstPasswordFormMap password_form_map_; | 126 autofill::ConstPasswordFormMap password_form_map_; |
121 | 127 |
122 // We create copies of PasswordForm objects that come in via OnLoginsChanged() | |
123 // and store them in this vector as well as in |password_form_map_| to ensure | |
124 // that we destroy them correctly. | |
125 ScopedVector<autofill::PasswordForm> new_password_forms_; | |
126 | |
127 // The current state of the password manager. Protected so we can manipulate | 128 // The current state of the password manager. Protected so we can manipulate |
128 // the value in tests. | 129 // the value in tests. |
129 password_manager::ui::State state_; | 130 password_manager::ui::State state_; |
130 | 131 |
131 // Used to measure the amount of time on a page; if it's less than some | 132 // Used to measure the amount of time on a page; if it's less than some |
132 // reasonable limit, then don't close the bubble upon navigation. We create | 133 // reasonable limit, then don't close the bubble upon navigation. We create |
133 // (and destroy) the timer in DidNavigateMainFrame. | 134 // (and destroy) the timer in DidNavigateMainFrame. |
134 scoped_ptr<base::ElapsedTimer> timer_; | 135 scoped_ptr<base::ElapsedTimer> timer_; |
135 | 136 |
136 private: | 137 private: |
(...skipping 23 matching lines...) Expand all Loading... |
160 | 161 |
161 // The origin of the form we're currently dealing with; we'll use this to | 162 // The origin of the form we're currently dealing with; we'll use this to |
162 // determine which PasswordStore changes we should care about when updating | 163 // determine which PasswordStore changes we should care about when updating |
163 // |password_form_map_|. | 164 // |password_form_map_|. |
164 GURL origin_; | 165 GURL origin_; |
165 | 166 |
166 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); | 167 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController); |
167 }; | 168 }; |
168 | 169 |
169 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ | 170 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_ |
OLD | NEW |