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

Side by Side 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: refactor 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "chrome/browser/ui/views/browser_modal_dialog.h"
13
14 class ForceSignoutDialogView;
15 class Profile;
16 class SigninManager;
17
18 // A modal dialog that displays a warning message of the auth failure
19 // before signing the user out and closing browser windows.
20 class ForceSignoutDialog : public BrowserModalDialog {
21 public:
22 // Show the warning dialog on the browser window that is belonged to the
23 // |profile|. Sign out the profile directly if there is no opened browser
24 // window or tabs.
25 // Sign out the profile if user confirmed the window or sign out the profile
26 // with a delay if signout_timer is set.
27 static void ShowDialog(Profile* profile,
28 SigninManager* signin_manager,
29 const base::Closure& signout_timer);
30
31 // override BrowserModalDialog
32 void ActivateModalDialog() override;
33 bool IsShowing() override;
34
35 // Return true if SignoutTimer is set.
36 bool IsDelayAllowed();
37 void OnAccept();
38 void OnCancel();
39 std::string GetEmail();
40 void OnViewClosing();
41
42 ForceSignoutDialog(SigninManager* signin_manager,
43 const base::Closure& signout_timer);
44 ~ForceSignoutDialog();
45
46 static ForceSignoutDialogView* GetDialogViewForTesting();
47
48 private:
49 SigninManager* signin_manager_;
50 const base::Closure signout_timer_;
51
52 static ForceSignoutDialogView* dialog_view_;
53
54 DISALLOW_COPY_AND_ASSIGN(ForceSignoutDialog);
55 };
56
57 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698