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

Unified 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: delegate Created 3 years, 6 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/forced_reauthentication_dialog.h
diff --git a/chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h b/chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h
index 3e377d109120dac21467ac64cfb991ca5d8bca4a..44d47f5333eb55f12dfbdab93bed405e5144300d 100644
--- a/chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h
+++ b/chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/window/dialog_delegate.h"
@@ -32,7 +33,7 @@ class ForcedReauthenticationDialog : public views::DialogDelegateView {
static ForcedReauthenticationDialog* ShowDialog(
Profile* profile,
SigninManager* signin_manager,
- const base::TimeDelta& countdown_duration);
+ base::TimeDelta countdown_duration);
// override views::DialogDelegateView
bool Accept() override;
@@ -45,11 +46,18 @@ class ForcedReauthenticationDialog : public views::DialogDelegateView {
// override views::View
void AddedToWidget() override;
+ // Close the dialog
+ void CloseDialog();
+
+ base::WeakPtr<ForcedReauthenticationDialog> AsWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+ }
+
private:
// Show the dialog for |browser|. The dialog will delete itself after closing.
ForcedReauthenticationDialog(Browser* browser,
SigninManager* signin_manager,
- const base::TimeDelta& countdown_duration);
+ base::TimeDelta countdown_duration);
void OnCountDown();
base::TimeDelta GetTimeRemaining() const;
@@ -63,6 +71,8 @@ class ForcedReauthenticationDialog : public views::DialogDelegateView {
// remaining time.
base::RepeatingTimer refresh_timer_;
+ base::WeakPtrFactory<ForcedReauthenticationDialog> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ForcedReauthenticationDialog);
};

Powered by Google App Engine
This is Rietveld 408576698