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

Side by Side Diff: chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h

Issue 2944713003: After signin token check failed, show force reauth dialog and start window closing countdown. (Closed)
Patch Set: nit Created 3 years, 5 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_FORCED_REAUTHENTICATION_DIALOG_H_
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_FORCED_REAUTHENTICATION_DIALOG_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/timer/timer.h"
14 #include "ui/views/controls/button/button.h"
15 #include "ui/views/window/dialog_delegate.h"
16
17 class Browser;
18 class Profile;
19 class SigninManager;
20
21 // A modal dialog that displays a warning message of the auth failure
22 // and ask user to sign in again.
23 class ForcedReauthenticationDialog : public views::DialogDelegateView {
24 public:
25 ~ForcedReauthenticationDialog() override;
26
27 // Shows a warning dialog for |profile|. If there are no Browser windows
28 // associated with |profile|, signs out the profile immediately, otherwise the
29 // user can clicks accept to sign in again. Dialog will be closed after
30 // |countdown_duration| seconds.
31 // Dialog will delete itself after closing.
32 static ForcedReauthenticationDialog* ShowDialog(
33 Profile* profile,
34 SigninManager* signin_manager,
35 const base::TimeDelta& countdown_duration);
36
37 // override views::DialogDelegateView
38 bool Accept() override;
39 bool Cancel() override;
40 void WindowClosing() override;
41 base::string16 GetWindowTitle() const override;
42 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
43 ui::ModalType GetModalType() const override;
44
45 // override views::View
46 void AddedToWidget() override;
47
48 private:
49 // Show the dialog for |browser|. The dialog will delete itself after closing.
50 ForcedReauthenticationDialog(Browser* browser,
51 SigninManager* signin_manager,
52 const base::TimeDelta& countdown_duration);
53
54 void OnCountDown();
55 base::TimeDelta GetTimeRemaining() const;
56
57 Browser* browser_;
58 SigninManager* signin_manager_;
59
60 const base::TimeTicks desired_close_time_;
61
62 // The timer which is used to refresh the dialog title to display the
63 // remaining time.
64 base::RepeatingTimer refresh_timer_;
65
66 DISALLOW_COPY_AND_ASSIGN(ForcedReauthenticationDialog);
67 };
68
69 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_FORCED_REAUTHENTICATION_DIALOG_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/forced_reauthentication_dialog.h ('k') | chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698