Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/profiles/profile_attributes_storage.h

Issue 1631373003: Refactor ProfileInfoCache in c/b/ui/app_list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments, add sorting of ProfileAttributesEntry Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_ 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_ 6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string>
11 #include <vector>
12
10 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/string16.h"
15 #include "chrome/browser/profiles/profile_info_cache_observer.h"
11 16
17 namespace base {
18 class FilePath;
19 } // namespace base
12 class ProfileAttributesEntry; 20 class ProfileAttributesEntry;
13 21
14 class ProfileAttributesStorage { 22 class ProfileAttributesStorage {
15 public: 23 public:
24 using Observer = ProfileInfoCacheObserver;
25
16 ProfileAttributesStorage() {} 26 ProfileAttributesStorage() {}
17 ~ProfileAttributesStorage() {} 27 ~ProfileAttributesStorage() {}
18 28
19 // If the |supervised_user_id| is non-empty, the profile will be marked to be 29 // If the |supervised_user_id| is non-empty, the profile will be marked to be
20 // omitted from the avatar-menu list on desktop versions. This is used while a 30 // omitted from the avatar-menu list on desktop versions. This is used while a
21 // supervised user is in the process of being registered with the server. Use 31 // supervised user is in the process of being registered with the server. Use
22 // ProfileAttributesEntry::SetIsOmitted() to clear the flag when the profile 32 // ProfileAttributesEntry::SetIsOmitted() to clear the flag when the profile
23 // is ready to be shown in the menu. 33 // is ready to be shown in the menu.
24 virtual void AddProfile(const base::FilePath& profile_path, 34 virtual void AddProfile(const base::FilePath& profile_path,
25 const base::string16& name, 35 const base::string16& name,
(...skipping 13 matching lines...) Expand all
39 // if the operation is successful and |entry| can be used. Returns false 49 // if the operation is successful and |entry| can be used. Returns false
40 // otherwise. 50 // otherwise.
41 // |entry| should not be cached as it may not reflect subsequent changes to 51 // |entry| should not be cached as it may not reflect subsequent changes to
42 // the profile's metadata. 52 // the profile's metadata.
43 virtual bool GetProfileAttributesWithPath( 53 virtual bool GetProfileAttributesWithPath(
44 const base::FilePath& path, ProfileAttributesEntry** entry) = 0; 54 const base::FilePath& path, ProfileAttributesEntry** entry) = 0;
45 55
46 // Returns the count of known profiles. 56 // Returns the count of known profiles.
47 virtual size_t GetNumberOfProfiles() const = 0; 57 virtual size_t GetNumberOfProfiles() const = 0;
48 58
59 virtual void AddObserver(ProfileAttributesStorage::Observer* observer) = 0;
60 virtual void RemoveObserver(ProfileAttributesStorage::Observer* observer) = 0;
61
62 private:
49 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesStorage); 63 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesStorage);
50 }; 64 };
51 65
52 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_ 66 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_STORAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698