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

Side by Side Diff: components/wifi_sync/wifi_credential_syncable_service.h

Issue 709683004: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-1-security-class
Patch Set: Created 6 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
6 #define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
7
8 #include <set>
9 #include <string>
10 #include <utility> // for std::pair
11 #include <vector>
12
13 #include "base/macros.h"
14 #include "base/threading/thread_checker.h"
15 #include "components/keyed_service/core/keyed_service.h"
16 #include "components/wifi_sync/wifi_security_class.h"
17 #include "sync/api/sync_data.h"
18 #include "sync/api/sync_error.h"
19 #include "sync/api/sync_error_factory.h"
20 #include "sync/api/syncable_service.h"
21
22 namespace content {
23 class BrowserContext;
24 } // content
25
26 namespace wifi_sync {
27
28 // KeyedService that synchronizes WiFi credentials between local settings,
29 // and Chrome Sync.
30 //
31 // This service does not necessarily own the storage for WiFi
32 // credentials. In particular, on ChromeOS, WiFi credential storage is
33 // managed by the ChromeOS connection manager ("shill").
stevenjb 2014/11/12 21:30:44 nit: Shill
mukesh agrawal 2014/11/13 16:24:58 Done.
34 class WifiCredentialSyncableService
35 : public syncer::SyncableService, public KeyedService {
36 public:
37 // Construct a service for the given |context|. Local changes will
stevenjb 2014/11/12 21:30:44 Constructs
mukesh agrawal 2014/11/13 16:24:58 Done.
38 // be applied to the Chrome Sync data for the user associated with
39 // |context|.
40 explicit WifiCredentialSyncableService(content::BrowserContext *context);
41 ~WifiCredentialSyncableService() override;
42
43 // syncer::SyncableService implementation.
44 syncer::SyncMergeResult MergeDataAndStartSyncing(
45 syncer::ModelType type,
46 const syncer::SyncDataList& initial_sync_data,
47 scoped_ptr<syncer::SyncChangeProcessor> sync_processor,
48 scoped_ptr<syncer::SyncErrorFactory> error_handler) override;
49 void StopSyncing(syncer::ModelType type) override;
stevenjb 2014/11/12 21:30:44 WS
mukesh agrawal 2014/11/13 16:24:58 Sorry, I don't understand. What's normal practice
stevenjb 2014/11/13 22:55:35 So, normally overridden methods are not commented,
mukesh agrawal 2014/11/14 02:14:54 Done. Since the base class has many subclasses, I
50 // The implementation of GetAllSyncData may not actually return the
51 // complete data list. In particular, the ChromeOS implementation
52 // will return an empty list.
53 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override;
54 syncer::SyncError ProcessSyncChanges(
55 const tracked_objects::Location& from_here,
56 const syncer::SyncChangeList& change_list) override;
57
58 // Test support.
59 std::set<std::pair<std::vector<char>, WifiSecurityClass>>
stevenjb 2014/11/12 21:30:44 Maybe typedef this (with 'using')?
mukesh agrawal 2014/11/13 16:24:58 Can do. Do we prefer something abstract (e.g. "Wif
stevenjb 2014/11/13 22:55:35 I'd split the difference, e.g. WifiSsidSecuritySet
mukesh agrawal 2014/11/14 02:14:53 Done.
60 GetWifiNetworksForTest() const;
61
62 private:
63 friend class WifiCredentialSyncableServiceTest;
64
65 static const enum syncer::ModelType kModelType;
66
67 // Const members.
68 const content::BrowserContext* const browser_context_;
69 const base::ThreadChecker thread_checker_;
70
71 // Non-const members.
72 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
73 scoped_ptr<syncer::SyncErrorFactory> sync_error_handler_;
74
75 DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableService);
76 };
77
78 } // namespace wifi_sync
79
80 #endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698