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

Unified Diff: chrome/browser/signin/force_signin_verifier.h

Issue 2944713003: After signin token check failed, show force reauth dialog and start window closing countdown. (Closed)
Patch Set: nit 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/signin/force_signin_verifier.h
diff --git a/chrome/browser/signin/force_signin_verifier.h b/chrome/browser/signin/force_signin_verifier.h
index 03548c03eba884fdc7343e9671601586617852a0..5106beef625ce7f41ed14b794d24458754cc582e 100644
--- a/chrome/browser/signin/force_signin_verifier.h
+++ b/chrome/browser/signin/force_signin_verifier.h
@@ -15,6 +15,7 @@
#include "net/base/backoff_entry.h"
#include "net/base/network_change_notifier.h"
+class ForcedReauthenticationDialog;
class Profile;
class SigninManager;
@@ -28,14 +29,14 @@ class ForceSigninVerifier
explicit ForceSigninVerifier(Profile* profile);
~ForceSigninVerifier() override;
- // OAuth2TokenService::Consumer implementation
+ // override OAuth2TokenService::Consumer
void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token,
const base::Time& expiration_time) override;
void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override;
- // net::NetworkChangeNotifier::NetworkChangeObserver
+ // override net::NetworkChangeNotifier::NetworkChangeObserver
void OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) override;
@@ -45,6 +46,9 @@ class ForceSigninVerifier
// Return the value of |has_token_verified_|.
bool HasTokenBeenVerified();
+ // Abort signout countdown.
+ void AbortSignoutCountdownIfExisted();
+
protected:
// Send the token verification request. The request will be sent only if
// - The token has never been verified before.
@@ -60,13 +64,25 @@ class ForceSigninVerifier
// browser window.
virtual void ShowDialog();
+ // Start the window closing countdown, return the duration.
+ base::TimeDelta StartCountdown();
+
OAuth2TokenService::Request* GetRequestForTesting();
net::BackoffEntry* GetBackoffEntryForTesting();
base::OneShotTimer* GetOneShotTimerForTesting();
+ base::OneShotTimer* GetWindowCloseTimerForTesting();
private:
+ void CloseAllBrowserWindows();
+
std::unique_ptr<OAuth2TokenService::Request> access_token_request_;
+#if !defined(OS_MACOSX)
+ Profile* profile_;
+
+ std::unique_ptr<ForcedReauthenticationDialog> dialog_;
+#endif
+
// Indicates whether the verification is finished successfully or with a
// persistent error.
bool has_token_verified_;
@@ -78,6 +94,9 @@ class ForceSigninVerifier
base::Time token_request_time_;
+ // The countdown of window closing.
+ base::OneShotTimer window_close_timer_;
+
DISALLOW_COPY_AND_ASSIGN(ForceSigninVerifier);
};
« no previous file with comments | « chrome/browser/signin/chrome_signin_client_unittest.cc ('k') | chrome/browser/signin/force_signin_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698