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 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 5 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/history/history_service_factory.h" | 9 #include "chrome/browser/history/history_service_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return delegate; | 54 return delegate; |
55 #endif | 55 #endif |
56 } | 56 } |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 NotificationServiceSessionsRouter::NotificationServiceSessionsRouter( | 60 NotificationServiceSessionsRouter::NotificationServiceSessionsRouter( |
61 Profile* profile, | 61 Profile* profile, |
62 SyncSessionsClient* sessions_client, | 62 SyncSessionsClient* sessions_client, |
63 const syncer::SyncableService::StartSyncFlare& flare) | 63 const syncer::SyncableService::StartSyncFlare& flare) |
64 : handler_(NULL), | 64 : handler_(nullptr), |
65 profile_(profile), | 65 profile_(profile), |
66 sessions_client_(sessions_client), | 66 sessions_client_(sessions_client), |
67 flare_(flare), | 67 flare_(flare), |
68 weak_ptr_factory_(this) { | 68 weak_ptr_factory_(this) { |
69 registrar_.Add(this, chrome::NOTIFICATION_TAB_PARENTED, | 69 registrar_.Add(this, chrome::NOTIFICATION_TAB_PARENTED, |
70 content::NotificationService::AllSources()); | 70 content::NotificationService::AllSources()); |
71 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 71 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
72 content::NotificationService::AllSources()); | 72 content::NotificationService::AllSources()); |
73 registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED, | 73 registrar_.Add(this, content::NOTIFICATION_NAV_LIST_PRUNED, |
74 content::NotificationService::AllSources()); | 74 content::NotificationService::AllSources()); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 | 201 |
202 void NotificationServiceSessionsRouter::StartRoutingTo( | 202 void NotificationServiceSessionsRouter::StartRoutingTo( |
203 LocalSessionEventHandler* handler) { | 203 LocalSessionEventHandler* handler) { |
204 DCHECK(!handler_); | 204 DCHECK(!handler_); |
205 handler_ = handler; | 205 handler_ = handler; |
206 } | 206 } |
207 | 207 |
208 void NotificationServiceSessionsRouter::Stop() { | 208 void NotificationServiceSessionsRouter::Stop() { |
209 weak_ptr_factory_.InvalidateWeakPtrs(); | 209 weak_ptr_factory_.InvalidateWeakPtrs(); |
210 handler_ = NULL; | 210 handler_ = nullptr; |
211 } | 211 } |
212 | 212 |
213 } // namespace sync_sessions | 213 } // namespace sync_sessions |
OLD | NEW |