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 "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" | 9 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual void Observe(int type, | 34 virtual void Observe(int type, |
35 const content::NotificationSource& source, | 35 const content::NotificationSource& source, |
36 const content::NotificationDetails& details) OVERRIDE; | 36 const content::NotificationDetails& details) OVERRIDE; |
37 | 37 |
38 // SessionsSyncManager::LocalEventRouter implementation. | 38 // SessionsSyncManager::LocalEventRouter implementation. |
39 virtual void StartRoutingTo(LocalSessionEventHandler* handler) OVERRIDE; | 39 virtual void StartRoutingTo(LocalSessionEventHandler* handler) OVERRIDE; |
40 virtual void Stop() OVERRIDE; | 40 virtual void Stop() OVERRIDE; |
41 | 41 |
42 private: | 42 private: |
43 // Called when the URL visited in |web_contents| was blocked by the | 43 // Called when the URL visited in |web_contents| was blocked by the |
44 // ManagedUserService. We forward this on to our handler_ via the | 44 // SupervisedUserService. We forward this on to our handler_ via the |
45 // normal OnLocalTabModified, but pass through here via a WeakPtr | 45 // normal OnLocalTabModified, but pass through here via a WeakPtr |
46 // callback from ManagedUserService and to extract the tab delegate | 46 // callback from SupervisedUserService and to extract the tab delegate |
47 // from WebContents. | 47 // from WebContents. |
48 void OnNavigationBlocked(content::WebContents* web_contents); | 48 void OnNavigationBlocked(content::WebContents* web_contents); |
49 | 49 |
50 LocalSessionEventHandler* handler_; | 50 LocalSessionEventHandler* handler_; |
51 content::NotificationRegistrar registrar_; | 51 content::NotificationRegistrar registrar_; |
52 Profile* const profile_; | 52 Profile* const profile_; |
53 syncer::SyncableService::StartSyncFlare flare_; | 53 syncer::SyncableService::StartSyncFlare flare_; |
54 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; | 54 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); | 56 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace browser_sync | 59 } // namespace browser_sync |
60 | 60 |
61 #endif // CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | 61 #endif // CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ |
OLD | NEW |