#include "ui/message_center/notification.h"
#include "ui/message_center/notification_delegate.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/user_flow.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
+#endif
+
namespace {
const char kProfileSigninNotificationId[] = "chrome://settings/signin/";
return;
}
+#if defined(OS_CHROMEOS)
+ if (chromeos::UserManager::IsInitialized()) {
+ chromeos::UserFlow* user_flow =
+ chromeos::UserManager::Get()->GetCurrentUserFlow();
+
+ // Check whether Chrome OS user flow allows launching browser.
+ // Example: Supervised user creation flow which handles token invalidation
+ // itself and notifications should be suppressed. http://crbug.com/359045
+ if (!user_flow->ShouldLaunchBrowser())
+ return;
+ }
+#endif
+
// Add an accept button to sign the user out.
message_center::RichNotificationData data;
data.buttons.push_back(message_center::ButtonInfo(