| OLD | NEW |
| 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_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "components/sync_driver/ui_data_type_controller.h" | 8 #include "components/sync_driver/ui_data_type_controller.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace browser_sync { | 14 namespace browser_sync { |
| 15 | 15 |
| 16 // Overrides StartModels to avoid sync contention with sessions during | 16 // Overrides StartModels to avoid sync contention with sessions during |
| 17 // a session restore operation at startup. | 17 // a session restore operation at startup. |
| 18 class SessionDataTypeController : public UIDataTypeController, | 18 class SessionDataTypeController : public sync_driver::UIDataTypeController, |
| 19 public content::NotificationObserver { | 19 public content::NotificationObserver { |
| 20 public: | 20 public: |
| 21 SessionDataTypeController(SyncApiComponentFactory* factory, | 21 SessionDataTypeController(sync_driver::SyncApiComponentFactory* factory, |
| 22 Profile* profile, | 22 Profile* profile, |
| 23 const DisableTypeCallback& disable_callback); | 23 const DisableTypeCallback& disable_callback); |
| 24 | 24 |
| 25 // NotificationObserver interface. | 25 // NotificationObserver interface. |
| 26 virtual void Observe(int type, | 26 virtual void Observe(int type, |
| 27 const content::NotificationSource& source, | 27 const content::NotificationSource& source, |
| 28 const content::NotificationDetails& details) OVERRIDE; | 28 const content::NotificationDetails& details) OVERRIDE; |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 virtual ~SessionDataTypeController(); | 31 virtual ~SessionDataTypeController(); |
| 32 virtual bool StartModels() OVERRIDE; | 32 virtual bool StartModels() OVERRIDE; |
| 33 virtual void StopModels() OVERRIDE; | 33 virtual void StopModels() OVERRIDE; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 Profile* const profile_; | 36 Profile* const profile_; |
| 37 content::NotificationRegistrar notification_registrar_; | 37 content::NotificationRegistrar notification_registrar_; |
| 38 DISALLOW_COPY_AND_ASSIGN(SessionDataTypeController); | 38 DISALLOW_COPY_AND_ASSIGN(SessionDataTypeController); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace browser_sync | 41 } // namespace browser_sync |
| 42 | 42 |
| 43 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ | 43 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_DATA_TYPE_CONTROLLER_H_ |
| 44 | 44 |
| OLD | NEW |