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

Side by Side Diff: components/sync_sessions/session_data_type_controller.h

Issue 2376123003: [Sync] Move //components/sync to the syncer namespace. (Closed)
Patch Set: Rebase. Created 4 years, 2 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 COMPONENTS_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ 5 #ifndef COMPONENTS_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_
6 #define COMPONENTS_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ 6 #define COMPONENTS_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/prefs/pref_change_registrar.h" 11 #include "components/prefs/pref_change_registrar.h"
12 #include "components/sync/device_info/local_device_info_provider.h" 12 #include "components/sync/device_info/local_device_info_provider.h"
13 #include "components/sync/driver/ui_data_type_controller.h" 13 #include "components/sync/driver/ui_data_type_controller.h"
14 14
15 namespace sync_sessions { 15 namespace sync_sessions {
16 16
17 // Overrides StartModels to avoid sync contention with sessions during 17 // Overrides StartModels to avoid sync contention with sessions during
18 // a session restore operation at startup and to wait for the local 18 // a session restore operation at startup and to wait for the local
19 // device info to become available. 19 // device info to become available.
20 class SessionDataTypeController : public sync_driver::UIDataTypeController { 20 class SessionDataTypeController : public syncer::UIDataTypeController {
21 public: 21 public:
22 // |dump_stack| is called when an unrecoverable error occurs. 22 // |dump_stack| is called when an unrecoverable error occurs.
23 SessionDataTypeController(const base::Closure& dump_stack, 23 SessionDataTypeController(const base::Closure& dump_stack,
24 sync_driver::SyncClient* sync_client, 24 syncer::SyncClient* sync_client,
25 sync_driver::LocalDeviceInfoProvider* local_device, 25 syncer::LocalDeviceInfoProvider* local_device,
26 const char* history_disabled_pref_name); 26 const char* history_disabled_pref_name);
27 ~SessionDataTypeController() override; 27 ~SessionDataTypeController() override;
28 28
29 // UIDataTypeController interface. 29 // UIDataTypeController interface.
30 bool StartModels() override; 30 bool StartModels() override;
31 void StopModels() override; 31 void StopModels() override;
32 bool ReadyForStart() const override; 32 bool ReadyForStart() const override;
33 33
34 // Called when asynchronous session restore has completed. 34 // Called when asynchronous session restore has completed.
35 void OnSessionRestoreComplete(); 35 void OnSessionRestoreComplete();
36 36
37 private: 37 private:
38 bool IsWaiting(); 38 bool IsWaiting();
39 void MaybeCompleteLoading(); 39 void MaybeCompleteLoading();
40 void OnLocalDeviceInfoInitialized(); 40 void OnLocalDeviceInfoInitialized();
41 void OnSavingBrowserHistoryPrefChanged(); 41 void OnSavingBrowserHistoryPrefChanged();
42 42
43 sync_driver::SyncClient* const sync_client_; 43 syncer::SyncClient* const sync_client_;
44 44
45 sync_driver::LocalDeviceInfoProvider* const local_device_; 45 syncer::LocalDeviceInfoProvider* const local_device_;
46 std::unique_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> 46 std::unique_ptr<syncer::LocalDeviceInfoProvider::Subscription> subscription_;
47 subscription_;
48 47
49 // Name of the pref that indicates whether saving history is disabled. 48 // Name of the pref that indicates whether saving history is disabled.
50 const char* history_disabled_pref_name_; 49 const char* history_disabled_pref_name_;
51 50
52 // Flags that indicate the reason for pending loading models. 51 // Flags that indicate the reason for pending loading models.
53 bool waiting_on_session_restore_; 52 bool waiting_on_session_restore_;
54 bool waiting_on_local_device_info_; 53 bool waiting_on_local_device_info_;
55 54
56 PrefChangeRegistrar pref_registrar_; 55 PrefChangeRegistrar pref_registrar_;
57 56
58 DISALLOW_COPY_AND_ASSIGN(SessionDataTypeController); 57 DISALLOW_COPY_AND_ASSIGN(SessionDataTypeController);
59 }; 58 };
60 59
61 } // namespace sync_sessions 60 } // namespace sync_sessions
62 61
63 #endif // COMPONENTS_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ 62 #endif // COMPONENTS_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « components/sync_bookmarks/bookmark_model_associator.cc ('k') | components/sync_sessions/session_data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698