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/extensions/tab_helper.h" | 9 #include "chrome/browser/extensions/tab_helper.h" |
10 #include "chrome/browser/favicon/favicon_changed_details.h" | 10 #include "chrome/browser/favicon/favicon_changed_details.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 content::NotificationService::AllSources()); | 49 content::NotificationService::AllSources()); |
50 registrar_.Add(this, | 50 registrar_.Add(this, |
51 chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, | 51 chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, |
52 content::NotificationService::AllSources()); | 52 content::NotificationService::AllSources()); |
53 registrar_.Add(this, | 53 registrar_.Add(this, |
54 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 54 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
55 content::NotificationService::AllBrowserContextsAndSources()); | 55 content::NotificationService::AllBrowserContextsAndSources()); |
56 registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, | 56 registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, |
57 content::Source<Profile>(profile_)); | 57 content::Source<Profile>(profile_)); |
58 #if defined(ENABLE_MANAGED_USERS) | 58 #if defined(ENABLE_MANAGED_USERS) |
59 if (profile_->IsManaged()) { | 59 if (profile_->IsSupervised()) { |
60 ManagedUserService* managed_user_service = | 60 ManagedUserService* managed_user_service = |
61 ManagedUserServiceFactory::GetForProfile(profile_); | 61 ManagedUserServiceFactory::GetForProfile(profile_); |
62 managed_user_service->AddNavigationBlockedCallback( | 62 managed_user_service->AddNavigationBlockedCallback( |
63 base::Bind(&NotificationServiceSessionsRouter::OnNavigationBlocked, | 63 base::Bind(&NotificationServiceSessionsRouter::OnNavigationBlocked, |
64 weak_ptr_factory_.GetWeakPtr())); | 64 weak_ptr_factory_.GetWeakPtr())); |
65 } | 65 } |
66 #endif | 66 #endif |
67 } | 67 } |
68 | 68 |
69 NotificationServiceSessionsRouter::~NotificationServiceSessionsRouter() {} | 69 NotificationServiceSessionsRouter::~NotificationServiceSessionsRouter() {} |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 DCHECK(!handler_); | 154 DCHECK(!handler_); |
155 handler_ = handler; | 155 handler_ = handler; |
156 } | 156 } |
157 | 157 |
158 void NotificationServiceSessionsRouter::Stop() { | 158 void NotificationServiceSessionsRouter::Stop() { |
159 weak_ptr_factory_.InvalidateWeakPtrs(); | 159 weak_ptr_factory_.InvalidateWeakPtrs(); |
160 handler_ = NULL; | 160 handler_ = NULL; |
161 } | 161 } |
162 | 162 |
163 } // namespace browser_sync | 163 } // namespace browser_sync |
OLD | NEW |