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

Unified Diff: chrome/browser/ui/views/profiles/force_signout_dialog.h

Issue 2862653002: If force-sign-in policy is enabled, popup warning dialog before window closing if auth token becom… (Closed)
Patch Set: remove app_modal:: Created 3 years, 7 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/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..a863a756786cb30ebf81b23ae2863c0f8ec87d4f
--- /dev/null
+++ b/chrome/browser/ui/views/profiles/force_signout_dialog.h
@@ -0,0 +1,58 @@
+// 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"
+
+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:
+ // 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);
+
+ // Activate the modal dialog.
+ static void ActivateModalDialog();
+
+ // Return true if modal dialog is visible.
+ static bool IsShowing();
+
+ // 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_

Powered by Google App Engine
This is Rietveld 408576698