Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / signin / signin_error_notifier_ash.cc
index 23b0a7c..a98511e 100644 (file)
 #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/";
@@ -155,6 +160,19 @@ void SigninErrorNotifier::OnErrorChanged() {
     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(