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

Side by Side Diff: chrome/browser/supervised_user/legacy/supervised_user_sync_service.h

Issue 1878143002: Convert //chrome/browser/supervised_user from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_LEGACY_SUPERVISED_USER_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_SYNC_SERVICE_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_obs erver.h" 15 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_obs erver.h"
16 #include "chrome/browser/supervised_user/supervised_users.h" 16 #include "chrome/browser/supervised_user/supervised_users.h"
17 #include "components/keyed_service/core/keyed_service.h" 17 #include "components/keyed_service/core/keyed_service.h"
18 #include "components/signin/core/browser/signin_manager_base.h" 18 #include "components/signin/core/browser/signin_manager_base.h"
19 #include "sync/api/syncable_service.h" 19 #include "sync/api/syncable_service.h"
20 20
21 namespace base { 21 namespace base {
22 class DictionaryValue; 22 class DictionaryValue;
23 } 23 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // users managed by this custodian. 109 // users managed by this custodian.
110 void GetSupervisedUsersAsync(const SupervisedUsersCallback& callback); 110 void GetSupervisedUsersAsync(const SupervisedUsersCallback& callback);
111 111
112 // KeyedService implementation: 112 // KeyedService implementation:
113 void Shutdown() override; 113 void Shutdown() override;
114 114
115 // SyncableService implementation: 115 // SyncableService implementation:
116 syncer::SyncMergeResult MergeDataAndStartSyncing( 116 syncer::SyncMergeResult MergeDataAndStartSyncing(
117 syncer::ModelType type, 117 syncer::ModelType type,
118 const syncer::SyncDataList& initial_sync_data, 118 const syncer::SyncDataList& initial_sync_data,
119 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, 119 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor,
120 scoped_ptr<syncer::SyncErrorFactory> error_handler) override; 120 std::unique_ptr<syncer::SyncErrorFactory> error_handler) override;
121 void StopSyncing(syncer::ModelType type) override; 121 void StopSyncing(syncer::ModelType type) override;
122 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; 122 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override;
123 syncer::SyncError ProcessSyncChanges( 123 syncer::SyncError ProcessSyncChanges(
124 const tracked_objects::Location& from_here, 124 const tracked_objects::Location& from_here,
125 const syncer::SyncChangeList& change_list) override; 125 const syncer::SyncChangeList& change_list) override;
126 126
127 private: 127 private:
128 friend class SupervisedUserSyncServiceFactory; 128 friend class SupervisedUserSyncServiceFactory;
129 129
130 // Use |SupervisedUserSyncServiceFactory::GetForProfile(...)| to get an 130 // Use |SupervisedUserSyncServiceFactory::GetForProfile(...)| to get an
131 // instance of this service. 131 // instance of this service.
132 explicit SupervisedUserSyncService(Profile* profile); 132 explicit SupervisedUserSyncService(Profile* profile);
133 133
134 // SigninManagerBase::Observer implementation. 134 // SigninManagerBase::Observer implementation.
135 void GoogleSignedOut(const std::string& account_id, 135 void GoogleSignedOut(const std::string& account_id,
136 const std::string& username) override; 136 const std::string& username) override;
137 137
138 scoped_ptr<base::DictionaryValue> CreateDictionary( 138 std::unique_ptr<base::DictionaryValue> CreateDictionary(
139 const std::string& name, 139 const std::string& name,
140 const std::string& master_key, 140 const std::string& master_key,
141 const std::string& signature_key, 141 const std::string& signature_key,
142 const std::string& encryption_key, 142 const std::string& encryption_key,
143 int avatar_index); 143 int avatar_index);
144 144
145 void UpdateSupervisedUserImpl(const std::string& id, 145 void UpdateSupervisedUserImpl(const std::string& id,
146 const std::string& name, 146 const std::string& name,
147 const std::string& master_key, 147 const std::string& master_key,
148 const std::string& signature_key, 148 const std::string& signature_key,
149 const std::string& encryption_key, 149 const std::string& encryption_key,
150 int avatar_index, 150 int avatar_index,
151 bool add_user); 151 bool add_user);
152 152
153 void NotifySupervisedUserAcknowledged(const std::string& supervised_user_id); 153 void NotifySupervisedUserAcknowledged(const std::string& supervised_user_id);
154 void NotifySupervisedUsersSyncingStopped(); 154 void NotifySupervisedUsersSyncingStopped();
155 void NotifySupervisedUsersChanged(); 155 void NotifySupervisedUsersChanged();
156 156
157 void DispatchCallbacks(); 157 void DispatchCallbacks();
158 158
159 Profile* profile_; 159 Profile* profile_;
160 PrefService* prefs_; 160 PrefService* prefs_;
161 161
162 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; 162 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor_;
163 scoped_ptr<syncer::SyncErrorFactory> error_handler_; 163 std::unique_ptr<syncer::SyncErrorFactory> error_handler_;
164 164
165 base::ObserverList<SupervisedUserSyncServiceObserver> observers_; 165 base::ObserverList<SupervisedUserSyncServiceObserver> observers_;
166 166
167 std::vector<SupervisedUsersCallback> callbacks_; 167 std::vector<SupervisedUsersCallback> callbacks_;
168 168
169 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSyncService); 169 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSyncService);
170 }; 170 };
171 171
172 #endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_SYNC_SERVICE_H_ 172 #endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698