| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/stl_util.h" | |
| 16 #include "components/autofill/core/browser/field_types.h" | 15 #include "components/autofill/core/browser/field_types.h" |
| 17 #include "components/autofill/core/common/password_form.h" | 16 #include "components/autofill/core/common/password_form.h" |
| 18 #include "components/password_manager/core/browser/password_manager_driver.h" | 17 #include "components/password_manager/core/browser/password_manager_driver.h" |
| 19 #include "components/password_manager/core/browser/password_store.h" | 18 #include "components/password_manager/core/browser/password_store.h" |
| 20 #include "components/password_manager/core/browser/password_store_consumer.h" | 19 #include "components/password_manager/core/browser/password_store_consumer.h" |
| 21 | 20 |
| 22 namespace password_manager { | 21 namespace password_manager { |
| 23 | 22 |
| 24 class PasswordManager; | 23 class PasswordManager; |
| 25 class PasswordManagerClient; | 24 class PasswordManagerClient; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 bool UploadPasswordForm(const autofill::FormData& form_data, | 327 bool UploadPasswordForm(const autofill::FormData& form_data, |
| 329 const autofill::ServerFieldType& password_type); | 328 const autofill::ServerFieldType& password_type); |
| 330 | 329 |
| 331 // Create pending credentials from provisionally saved form and forms received | 330 // Create pending credentials from provisionally saved form and forms received |
| 332 // from password store. | 331 // from password store. |
| 333 void CreatePendingCredentials(); | 332 void CreatePendingCredentials(); |
| 334 | 333 |
| 335 // Set of PasswordForms from the DB that best match the form | 334 // Set of PasswordForms from the DB that best match the form |
| 336 // being managed by this. Use a map instead of vector, because we most | 335 // being managed by this. Use a map instead of vector, because we most |
| 337 // frequently require lookups by username value in IsNewLogin. | 336 // frequently require lookups by username value in IsNewLogin. |
| 338 // TODO(vabr): Consider using ScopedPtrHashMap instead of the deleter below. | |
| 339 autofill::PasswordFormMap best_matches_; | 337 autofill::PasswordFormMap best_matches_; |
| 340 | 338 |
| 341 // Cleans up when best_matches_ goes out of scope. | |
| 342 STLValueDeleter<autofill::PasswordFormMap> best_matches_deleter_; | |
| 343 | |
| 344 // The PasswordForm from the page or dialog managed by |this|. | 339 // The PasswordForm from the page or dialog managed by |this|. |
| 345 const autofill::PasswordForm observed_form_; | 340 const autofill::PasswordForm observed_form_; |
| 346 | 341 |
| 347 // Stores provisionally saved form until |pending_credentials_| is created. | 342 // Stores provisionally saved form until |pending_credentials_| is created. |
| 348 scoped_ptr<const autofill::PasswordForm> provisionally_saved_form_; | 343 scoped_ptr<const autofill::PasswordForm> provisionally_saved_form_; |
| 349 // Stores if for creating |pending_credentials_| other possible usernames | 344 // Stores if for creating |pending_credentials_| other possible usernames |
| 350 // option should apply. | 345 // option should apply. |
| 351 OtherPossibleUsernamesAction other_possible_username_action_; | 346 OtherPossibleUsernamesAction other_possible_username_action_; |
| 352 | 347 |
| 353 // The origin url path of observed_form_ tokenized, for convenience when | 348 // The origin url path of observed_form_ tokenized, for convenience when |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 // as our classification of the form can change depending on what data the | 414 // as our classification of the form can change depending on what data the |
| 420 // user has entered. | 415 // user has entered. |
| 421 FormType form_type_; | 416 FormType form_type_; |
| 422 | 417 |
| 423 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 418 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| 424 }; | 419 }; |
| 425 | 420 |
| 426 } // namespace password_manager | 421 } // namespace password_manager |
| 427 | 422 |
| 428 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 423 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| OLD | NEW |