You need to implement the PasswordStore class which functions as a storage system for user login credentials (PasswordForms). The key features that need to be implemented or enhanced are as follows:
Implement functionality in the GetLogins method to ignore password forms submitted on www.google.com that are older than a specified cutoff date.
Ensure that valid logins from the new domain accounts.google.com, regardless of their age, are still retrievable.
Start Sync Flare:
Implement a mechanism that triggers a sync event when a login is added. This should utilize a StartSyncFlare mock to simulate the behavior during testing.
Update Login Primary Key Fields:
Implement the UpdateLoginWithPrimaryKey method to replace an existing login's credentials with a new credential while preserving the identified primary key fields.
Remove Logins Created Between:
Implement the RemoveLoginsCreatedBetween method to delete logins created within a specific timestamp range, ensuring that any notifications to observers are handled correctly post-deletion.
Get Logins with Affiliation:
Implement GetLoginsWithAffiliations to return logins associated with Android applications alongside web logins for the specific realm while excluding any unrelated logins.
Update Passwords Stored for Affiliated Websites:
Implement automatic updates of web login credentials whenever the Android app's password is changed, as per the defined relationships between app and web credentials.
Ensure all methods are tested according to the provided test cases. The solution code should be written in C++ and structured appropriately for integration into the existing project, with all new code placed in the /app/ directory.