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> |
| 9 |
| 10 #include "base/callback_list.h" |
8 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" | 12 #include "chrome/browser/sync/sessions/sessions_sync_manager.h" |
10 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
12 | 15 |
| 16 class GURL; |
| 17 class HistoryService; |
13 class Profile; | 18 class Profile; |
14 | 19 |
15 namespace content { | 20 namespace content { |
16 class WebContents; | 21 class WebContents; |
17 } | 22 } |
18 | 23 |
19 namespace browser_sync { | 24 namespace browser_sync { |
20 | 25 |
21 // A SessionsSyncManager::LocalEventRouter that drives session sync via | 26 // A SessionsSyncManager::LocalEventRouter that drives session sync via |
22 // the NotificationService. | 27 // the NotificationService. |
(...skipping 17 matching lines...) Expand all Loading... |
40 virtual void Stop() OVERRIDE; | 45 virtual void Stop() OVERRIDE; |
41 | 46 |
42 private: | 47 private: |
43 // 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 |
44 // SupervisedUserService. We forward this on to our handler_ via the | 49 // SupervisedUserService. We forward this on to our handler_ via the |
45 // normal OnLocalTabModified, but pass through here via a WeakPtr | 50 // normal OnLocalTabModified, but pass through here via a WeakPtr |
46 // callback from SupervisedUserService and to extract the tab delegate | 51 // callback from SupervisedUserService and to extract the tab delegate |
47 // from WebContents. | 52 // from WebContents. |
48 void OnNavigationBlocked(content::WebContents* web_contents); | 53 void OnNavigationBlocked(content::WebContents* web_contents); |
49 | 54 |
| 55 // Called when the urls of favicon changed. |
| 56 void OnFaviconChanged(const std::set<GURL>& changed_favicons); |
| 57 |
50 LocalSessionEventHandler* handler_; | 58 LocalSessionEventHandler* handler_; |
51 content::NotificationRegistrar registrar_; | 59 content::NotificationRegistrar registrar_; |
52 Profile* const profile_; | 60 Profile* const profile_; |
53 syncer::SyncableService::StartSyncFlare flare_; | 61 syncer::SyncableService::StartSyncFlare flare_; |
54 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; | 62 base::WeakPtrFactory<NotificationServiceSessionsRouter> weak_ptr_factory_; |
55 | 63 |
| 64 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> |
| 65 favicon_changed_subscription_; |
| 66 |
56 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); | 67 DISALLOW_COPY_AND_ASSIGN(NotificationServiceSessionsRouter); |
57 }; | 68 }; |
58 | 69 |
59 } // namespace browser_sync | 70 } // namespace browser_sync |
60 | 71 |
61 #endif // CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ | 72 #endif // CHROME_BROWSER_SYNC_SESSIONS_NOTIFICATION_SERVICE_SESSIONS_ROUTER_H_ |
OLD | NEW |