Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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 CHROME_BROWSER_SYNC_SESSIONS2_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | |
| 6 #define CHROME_BROWSER_SYNC_SESSIONS2_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "chrome/browser/sync/sessions2/sessions_sync_manager.h" | |
| 10 #include "content/public/browser/notification_observer.h" | |
| 11 #include "content/public/browser/notification_registrar.h" | |
| 12 | |
| 13 class Profile; | |
| 14 | |
| 15 namespace content { | |
| 16 class WebContents; | |
| 17 } | |
| 18 | |
| 19 namespace browser_sync { | |
| 20 | |
| 21 // A SessionsSyncManager::LocalEventRouter that drives session sync via | |
| 22 // the NotificationService. | |
| 23 class NotificationServiceSessionsRouter | |
| 24 : public SessionsSyncManager::LocalEventRouter, | |
| 25 public content::NotificationObserver { | |
| 26 public: | |
| 27 explicit NotificationServiceSessionsRouter(Profile* profile); | |
| 28 virtual ~NotificationServiceSessionsRouter(); | |
| 29 | |
| 30 // content::NotificationObserver implementation. | |
| 31 // BrowserSessionProvider -> sync API model change application. | |
| 32 virtual void Observe(int type, | |
| 33 const content::NotificationSource& source, | |
| 34 const content::NotificationDetails& details) OVERRIDE; | |
| 35 | |
| 36 // SessionsSyncManager::LocalEventRouter implementation. | |
| 37 virtual void StartRoutingTo(LocalSessionEventHandler* handler) OVERRIDE; | |
| 38 virtual void Stop() OVERRIDE; | |
| 39 | |
| 40 void set_flare( | |
| 41 const syncer::SyncableService::StartSyncFlare& flare); | |
|
Nicolas Zea
2013/11/21 02:34:52
nit: looks like this can fit on one line? also, ne
tim (not reviewing)
2013/11/21 21:38:59
Done.
| |
| 42 private: | |
| 43 void OnNavigationBlocked(content::WebContents* web_contents); | |
|
Nicolas Zea
2013/11/21 02:34:52
nit: newline after. Also, comment what this functi
tim (not reviewing)
2013/11/21 21:38:59
Done.
| |
| 44 LocalSessionEventHandler* handler_; | |
| 45 content::NotificationRegistrar registrar_; | |
| 46 Profile* const profile_; | |
| 47 syncer::SyncableService::StartSyncFlare flare_; | |
| 48 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); | |
| 51 }; | |
| 52 | |
| 53 } // namespace browser_sync | |
| 54 | |
| 55 #endif // CHROME_BROWSER_SYNC_SESSIONS2_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | |
| OLD | NEW |