Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5864)

Unified Diff: chrome/browser/notifications/profile_notification.cc

Issue 2719813005: CrOS: Add print statements to help debug BrowserProcessImpl::Unpin crash. (Closed)
Patch Set: Added dumps. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..964ec68be2e1f114461b705d7a1e8f12967289c7 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: {
+ VLOG(1) << "ProfileNotification Terminating";
sky 2017/03/22 03:56:16 If you really need to log this information, add it
+ break;
+ }
+ case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: {
+ VLOG(1) << "ProfileNotification Close All Browsers Request";
+ break;
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698