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

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: cr 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..58de128ffe3512a5d9a60a1a4395c673042cceb6
--- /dev/null
+++ b/chrome/browser/ui/views/profiles/force_signout_dialog.h
@@ -0,0 +1,65 @@
+// 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/browser_list_observer.h"
+#include "chrome/browser/ui/views/browser_modal_dialog.h"
+
+class Browser;
+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 chrome::BrowserListObserver {
+ public:
+ ForceSignoutDialog(Browser* browser,
+ SigninManager* signin_manager,
+ const base::Closure& signout_timer);
sky 2017/05/17 18:03:18 signout_closure? Also, document what 'browser' and
zmin 2017/05/18 03:31:18 Done.
+ ~ForceSignoutDialog() override;
+
+ // Show the warning dialog on the browser window that is belonged to the
sky 2017/05/17 18:03:18 How about: Shows a warning dialog for |profile|.
zmin 2017/05/18 03:31:18 Done.
+ // |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 ForceSignoutDialog* ShowDialog(Profile* profile,
+ SigninManager* signin_manager,
+ const base::Closure& signout_timer);
+
+ // override BrowserModalDialog
+ void ActivateModalDialog(Browser* other_browser) override;
+ bool IsShowing() override;
+
+ // override chrome::BrowserListObserver
+ void OnBrowserRemoved(Browser* browser) override;
+
+ // Return true if SignoutTimer is set.
+ bool IsDelayAllowed();
+ void OnAccept();
+ void OnCancel();
+ std::string GetEmail();
+ void OnViewClosing();
+
+ ForceSignoutDialogView* GetDialogViewForTesting();
+
+ private:
+ Browser* browser_;
+ SigninManager* signin_manager_;
+ const base::Closure signout_timer_;
+
+ 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