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 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_CHANGE_H__ 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_CHANGE_H__ 7 8 #include <vector> 9 10 #include "components/autofill/core/common/password_form.h" 11 12 namespace password_manager { 13 14 class PasswordStoreChange { 15 public: 16 enum Type { 17 ADD, 18 UPDATE, 19 REMOVE, 20 }; 21 22 PasswordStoreChange(Type type, const autofill::PasswordForm& form) 23 : type_(type), form_(form) { 24 } 25 virtual ~PasswordStoreChange() {} 26 27 Type type() const { return type_; } 28 const autofill::PasswordForm& form() const { return form_; } 29 30 bool operator==(const PasswordStoreChange& other) const { 31 return type() == other.type() && 32 form().signon_realm == other.form().signon_realm && 33 form().origin == other.form().origin && 34 form().action == other.form().action && 35 form().submit_element == other.form().submit_element && 36 form().username_element == other.form().username_element && 37 form().username_value == other.form().username_value && 38 form().password_element == other.form().password_element && 39 form().password_value == other.form().password_value && 40 form().new_password_element == other.form().new_password_element && 41 form().new_password_value == other.form().new_password_value && 42 form().ssl_valid == other.form().ssl_valid && 43 form().preferred == other.form().preferred && 44 form().date_created == other.form().date_created && 45 form().blacklisted_by_user == other.form().blacklisted_by_user && 46 form().use_additional_authentication == 47 other.form().use_additional_authentication; 48 } 49 50 private: 51 Type type_; 52 autofill::PasswordForm form_; 53 }; 54 55 typedef std::vector<PasswordStoreChange> PasswordStoreChangeList; 56 57 } // namespace password_manager 58 59 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_CHANGE_H_ 60