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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_whitelist_service.h

Issue 875423002: Don't notify existing observers in SupervisedUserWhitelistService::AddSiteListsChangedCallback(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: typo Created 5 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 2014 The Chromium Authors. All rights reserved. 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 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_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void SetWhitelistProperties( 91 void SetWhitelistProperties(
92 base::DictionaryValue* pref_dict, 92 base::DictionaryValue* pref_dict,
93 const sync_pb::ManagedUserWhitelistSpecifics& whitelist); 93 const sync_pb::ManagedUserWhitelistSpecifics& whitelist);
94 void RemoveWhitelist(base::DictionaryValue* pref_dict, const std::string& id); 94 void RemoveWhitelist(base::DictionaryValue* pref_dict, const std::string& id);
95 95
96 // Registers a new or existing whitelist. 96 // Registers a new or existing whitelist.
97 void RegisterWhitelist(const std::string& id, 97 void RegisterWhitelist(const std::string& id,
98 const std::string& name, 98 const std::string& name,
99 bool new_installation); 99 bool new_installation);
100 100
101 void GetLoadedWhitelists(
102 std::vector<scoped_refptr<SupervisedUserSiteList>>* whitelists);
103
101 void NotifyWhitelistsChanged(); 104 void NotifyWhitelistsChanged();
102 105
103 void OnWhitelistReady(const std::string& id, 106 void OnWhitelistReady(const std::string& id,
104 const base::FilePath& whitelist_path); 107 const base::FilePath& whitelist_path);
105 void OnWhitelistLoaded( 108 void OnWhitelistLoaded(
106 const std::string& id, 109 const std::string& id,
107 base::TimeTicks start_time, 110 base::TimeTicks start_time,
108 const scoped_refptr<SupervisedUserSiteList>& whitelist); 111 const scoped_refptr<SupervisedUserSiteList>& whitelist);
109 112
110 PrefService* prefs_; 113 PrefService* prefs_;
111 scoped_ptr<component_updater::SupervisedUserWhitelistInstaller> installer_; 114 scoped_ptr<component_updater::SupervisedUserWhitelistInstaller> installer_;
112 std::vector<SiteListsChangedCallback> site_lists_changed_callbacks_; 115 std::vector<SiteListsChangedCallback> site_lists_changed_callbacks_;
113 116
114 // The set of registered whitelists. A whitelist might be registered but not 117 // The set of registered whitelists. A whitelist might be registered but not
115 // loaded yet, in which case it will not be in |loaded_whitelists_| yet. 118 // loaded yet, in which case it will not be in |loaded_whitelists_| yet.
116 // On the other hand, every loaded whitelist has to be registered. 119 // On the other hand, every loaded whitelist has to be registered.
117 std::set<std::string> registered_whitelists_; 120 std::set<std::string> registered_whitelists_;
118 std::map<std::string, scoped_refptr<SupervisedUserSiteList> > 121 std::map<std::string, scoped_refptr<SupervisedUserSiteList> >
119 loaded_whitelists_; 122 loaded_whitelists_;
120 123
121 base::WeakPtrFactory<SupervisedUserWhitelistService> weak_ptr_factory_; 124 base::WeakPtrFactory<SupervisedUserWhitelistService> weak_ptr_factory_;
122 125
123 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistService); 126 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistService);
124 }; 127 };
125 128
126 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ 129 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698