| 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_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ |
| 6 #define CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | 6 #define CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback_list.h" | 10 #include "base/callback_list.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 NotificationServiceSessionsRouter( | 32 NotificationServiceSessionsRouter( |
| 33 Profile* profile, | 33 Profile* profile, |
| 34 const syncer::SyncableService::StartSyncFlare& flare); | 34 const syncer::SyncableService::StartSyncFlare& flare); |
| 35 virtual ~NotificationServiceSessionsRouter(); | 35 virtual ~NotificationServiceSessionsRouter(); |
| 36 | 36 |
| 37 // content::NotificationObserver implementation. | 37 // content::NotificationObserver implementation. |
| 38 // BrowserSessionProvider -> sync API model change application. | 38 // BrowserSessionProvider -> sync API model change application. |
| 39 virtual void Observe(int type, | 39 virtual void Observe(int type, |
| 40 const content::NotificationSource& source, | 40 const content::NotificationSource& source, |
| 41 const content::NotificationDetails& details) OVERRIDE; | 41 const content::NotificationDetails& details) override; |
| 42 | 42 |
| 43 // SessionsSyncManager::LocalEventRouter implementation. | 43 // SessionsSyncManager::LocalEventRouter implementation. |
| 44 virtual void StartRoutingTo(LocalSessionEventHandler* handler) OVERRIDE; | 44 virtual void StartRoutingTo(LocalSessionEventHandler* handler) override; |
| 45 virtual void Stop() OVERRIDE; | 45 virtual void Stop() override; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // Called when the URL visited in |web_contents| was blocked by the | 48 // Called when the URL visited in |web_contents| was blocked by the |
| 49 // SupervisedUserService. We forward this on to our handler_ via the | 49 // SupervisedUserService. We forward this on to our handler_ via the |
| 50 // normal OnLocalTabModified, but pass through here via a WeakPtr | 50 // normal OnLocalTabModified, but pass through here via a WeakPtr |
| 51 // callback from SupervisedUserService and to extract the tab delegate | 51 // callback from SupervisedUserService and to extract the tab delegate |
| 52 // from WebContents. | 52 // from WebContents. |
| 53 void OnNavigationBlocked(content::WebContents* web_contents); | 53 void OnNavigationBlocked(content::WebContents* web_contents); |
| 54 | 54 |
| 55 // Called when the urls of favicon changed. | 55 // Called when the urls of favicon changed. |
| 56 void OnFaviconChanged(const std::set<GURL>& changed_favicons); | 56 void OnFaviconChanged(const std::set<GURL>& changed_favicons); |
| 57 | 57 |
| 58 LocalSessionEventHandler* handler_; | 58 LocalSessionEventHandler* handler_; |
| 59 content::NotificationRegistrar registrar_; | 59 content::NotificationRegistrar registrar_; |
| 60 Profile* const profile_; | 60 Profile* const profile_; |
| 61 syncer::SyncableService::StartSyncFlare flare_; | 61 syncer::SyncableService::StartSyncFlare flare_; |
| 62 | 62 |
| 63 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> | 63 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> |
| 64 favicon_changed_subscription_; | 64 favicon_changed_subscription_; |
| 65 | 65 |
| 66 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; | 66 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); | 68 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace browser_sync | 71 } // namespace browser_sync |
| 72 | 72 |
| 73 #endif // CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | 73 #endif // CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ |
| OLD | NEW |