Chromium Code Reviews| Index: chrome/browser/notifications/profile_notification.cc |
| diff --git a/chrome/browser/notifications/profile_notification.cc b/chrome/browser/notifications/profile_notification.cc |
| index b9814449b3590b5f3040c8c6a4aa0ae8a1c3799f..e500bda0f2c589371402d54c0da16d56ad196f93 100644 |
| --- a/chrome/browser/notifications/profile_notification.cc |
| +++ b/chrome/browser/notifications/profile_notification.cc |
| @@ -6,10 +6,12 @@ |
| #include "base/strings/stringprintf.h" |
| #include "build/build_config.h" |
| +#include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/lifetime/keep_alive_types.h" |
| #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| #include "components/signin/core/account_id/account_id.h" |
| +#include "content/public/browser/notification_service.h" |
| // static |
| std::string ProfileNotification::GetProfileNotificationId( |
| @@ -39,6 +41,26 @@ ProfileNotification::ProfileNotification(Profile* profile, |
| notification_.set_profile_id( |
| multi_user_util::GetAccountIdFromProfile(profile).GetUserEmail()); |
| #endif |
| + |
| + registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, |
| + content::NotificationService::AllSources()); |
| + registrar_.Add(this, chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| + content::NotificationService::AllSources()); |
| } |
| ProfileNotification::~ProfileNotification() {} |
| + |
| +void ProfileNotification::Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) { |
| + switch (type) { |
| + case chrome::NOTIFICATION_APP_TERMINATING: { |
| + DVLOG(1) << "ProfileNotification Terminating"; |
|
dgn
2017/03/20 11:07:22
Shouldn't that be a VLOG rather than DVLOG? Otherw
sammiequon
2017/03/20 17:20:06
Done.
|
| + break; |
| + } |
| + case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: { |
| + DVLOG(1) << "ProfileNotification Close All Browsers Request"; |
| + break; |
| + } |
| + } |
| +} |