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.h" | 9 #include "chrome/browser/history/history_service.h" |
10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 51 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
52 content::NotificationService::AllSources()); | 52 content::NotificationService::AllSources()); |
53 #if defined(ENABLE_EXTENSIONS) | 53 #if defined(ENABLE_EXTENSIONS) |
54 registrar_.Add(this, | 54 registrar_.Add(this, |
55 chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, | 55 chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, |
56 content::NotificationService::AllSources()); | 56 content::NotificationService::AllSources()); |
57 #endif | 57 #endif |
58 registrar_.Add(this, | 58 registrar_.Add(this, |
59 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 59 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
60 content::NotificationService::AllBrowserContextsAndSources()); | 60 content::NotificationService::AllBrowserContextsAndSources()); |
61 HistoryService* history_service = | 61 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
62 HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS); | 62 profile, ServiceAccessType::EXPLICIT_ACCESS); |
63 if (history_service) { | 63 if (history_service) { |
64 favicon_changed_subscription_ = history_service->AddFaviconChangedCallback( | 64 favicon_changed_subscription_ = history_service->AddFaviconChangedCallback( |
65 base::Bind(&NotificationServiceSessionsRouter::OnFaviconChanged, | 65 base::Bind(&NotificationServiceSessionsRouter::OnFaviconChanged, |
66 base::Unretained(this))); | 66 base::Unretained(this))); |
67 } | 67 } |
68 #if defined(ENABLE_SUPERVISED_USERS) | 68 #if defined(ENABLE_SUPERVISED_USERS) |
69 if (profile_->IsSupervised()) { | 69 if (profile_->IsSupervised()) { |
70 SupervisedUserService* supervised_user_service = | 70 SupervisedUserService* supervised_user_service = |
71 SupervisedUserServiceFactory::GetForProfile(profile_); | 71 SupervisedUserServiceFactory::GetForProfile(profile_); |
72 supervised_user_service->AddNavigationBlockedCallback( | 72 supervised_user_service->AddNavigationBlockedCallback( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 DCHECK(!handler_); | 166 DCHECK(!handler_); |
167 handler_ = handler; | 167 handler_ = handler; |
168 } | 168 } |
169 | 169 |
170 void NotificationServiceSessionsRouter::Stop() { | 170 void NotificationServiceSessionsRouter::Stop() { |
171 weak_ptr_factory_.InvalidateWeakPtrs(); | 171 weak_ptr_factory_.InvalidateWeakPtrs(); |
172 handler_ = NULL; | 172 handler_ = NULL; |
173 } | 173 } |
174 | 174 |
175 } // namespace browser_sync | 175 } // namespace browser_sync |
OLD | NEW |