Remove profile info cache entry on user removal on Chrome OS.

Chrome OS removes users when profiles are not loaded, and Chrome does not know
the exact profile path until it is mounted. So we need to be able to remove
entries from ProfileInfoCache based solely on AccountId.

This Cl implements removal of cache entries given the AccountId and engages it
on Chrome OS.

Bug: 808125
Change-Id: I9f8e3a5f1004d119425b92a4bdc3d8011a526dd5
Reviewed-on: https://chromium-review.googlesource.com/905751
Reviewed-by: anthonyvd <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Commit-Queue: Alexander Alekseev <[email protected]>
Cr-Commit-Position: refs/heads/master@{#537905}
diff --git a/chrome/browser/profiles/profile_attributes_storage.h b/chrome/browser/profiles/profile_attributes_storage.h
index 9c88220..425b3452 100644
--- a/chrome/browser/profiles/profile_attributes_storage.h
+++ b/chrome/browser/profiles/profile_attributes_storage.h
@@ -30,6 +30,7 @@
 class Image;
 }
 
+class AccountId;
 class PrefService;
 class ProfileAttributesEntry;
 class ProfileAvatarDownloader;
@@ -54,6 +55,11 @@
                           const base::string16& user_name,
                           size_t icon_index,
                           const std::string& supervised_user_id) = 0;
+
+  // Removes the profile matching given |account_id| from this storage.
+  // Calculates profile path and calls RemoveProfile() on it.
+  virtual void RemoveProfileByAccountId(const AccountId& account_id) = 0;
+
   // Removes the profile at |profile_path| from this storage. Does not delete or
   // affect the actual profile's data.
   virtual void RemoveProfile(const base::FilePath& profile_path) = 0;