Index: chrome/browser/ui/views/profiles/force_signout_dialog.h |
diff --git a/chrome/browser/ui/views/profiles/force_signout_dialog.h b/chrome/browser/ui/views/profiles/force_signout_dialog.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c1253c762fbdcaaa858f6cbaa757587488a4166b |
--- /dev/null |
+++ b/chrome/browser/ui/views/profiles/force_signout_dialog.h |
@@ -0,0 +1,57 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
+#define CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
+ |
+#include <string> |
+ |
+#include "base/callback.h" |
+#include "base/macros.h" |
+#include "chrome/browser/ui/views/browser_modal_dialog.h" |
+ |
+class ForceSignoutDialogView; |
+class Profile; |
+class SigninManager; |
+ |
+// A modal dialog that displays a warning message of the auth failure |
+// before signing the user out and closing browser windows. |
+class ForceSignoutDialog : public BrowserModalDialog { |
+ public: |
+ // Show the warning dialog on the browser window that is belonged to the |
+ // |profile|. Sign out the profile directly if there is no opened browser |
+ // window or tabs. |
+ // Sign out the profile if user confirmed the window or sign out the profile |
+ // with a delay if signout_timer is set. |
+ static void ShowDialog(Profile* profile, |
+ SigninManager* signin_manager, |
+ const base::Closure& signout_timer); |
+ |
+ // override BrowserModalDialog |
+ void ActivateModalDialog() override; |
+ bool IsShowing() override; |
+ |
+ // Return true if SignoutTimer is set. |
+ bool IsDelayAllowed(); |
+ void OnAccept(); |
+ void OnCancel(); |
+ std::string GetEmail(); |
+ void OnViewClosing(); |
+ |
+ ForceSignoutDialog(SigninManager* signin_manager, |
+ const base::Closure& signout_timer); |
+ ~ForceSignoutDialog(); |
+ |
+ static ForceSignoutDialogView* GetDialogViewForTesting(); |
+ |
+ private: |
+ SigninManager* signin_manager_; |
+ const base::Closure signout_timer_; |
+ |
+ static ForceSignoutDialogView* dialog_view_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ForceSignoutDialog); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |