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

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

Issue 2442843002: Override SigninManager::SignOut if force-signin is enabled. (Closed)
Patch Set: tommycli's comments Created 4 years, 2 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_manager.h
diff --git a/chrome/browser/signin/force_signin_manager.h b/chrome/browser/signin/force_signin_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..96555adedced8a37c8e5623dd0f02c065bc0b700
--- /dev/null
+++ b/chrome/browser/signin/force_signin_manager.h
@@ -0,0 +1,58 @@
+// Copyright 2016 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_SIGNIN_FORCE_SIGNIN_MANAGER_H_
+#define CHROME_BROWSER_SIGNIN_FORCE_SIGNIN_MANAGER_H_
+
+#include "components/signin/core/browser/signin_manager.h"
+
+namespace base {
+class FilePath;
+} // namespace base
+
+class Profile;
+
+// Signin Manager when force signin is enabled.
+class ForceSigninManager : public SigninManager {
+ public:
+ ForceSigninManager(Profile* profile,
+ SigninClient* client,
+ ProfileOAuth2TokenService* token_service,
+ AccountTrackerService* account_tracker_service,
+ GaiaCookieManagerService* cookie_manager_service);
+ ~ForceSigninManager() override;
+
+ // Close all browser windows before signout. If user abort the closing, the
+ // signout will be aborted too.
+ void SignOut(signin_metrics::ProfileSignout signout_source_metric,
+ signin_metrics::SignoutDelete signout_delete_metric) override;
+
+ // Return true is force signin policy is enabled.
+ static bool IsForceSigninEnabled();
+
+ // Next signout won't open UserManager after all browser windows are closed.
Roger Tawa OOO till Jul 10th 2016/10/26 18:25:31 Can you add a comment explaining why this is neede
Roger Tawa OOO till Jul 10th 2016/10/26 18:25:31 If I understood correctly, this is called in only
+ static void DisableUserManagerDisplayForNextSignOut(
+ SigninManager* signin_manager);
+
+ protected:
+ // Signout and lock the profile.
+ virtual void DoSignOut(signin_metrics::ProfileSignout signout_source_metric,
+ signin_metrics::SignoutDelete signout_delete_metric,
+ const base::FilePath& profile_path);
+ // Show UserManager.
+ virtual void ShowUserManager(const base::FilePath& profile_path);
+
+ private:
+ // Callback after all browser windows are closed successfully.
+ void PostCloseBrowsers(signin_metrics::ProfileSignout signout_source_metric,
+ signin_metrics::SignoutDelete signout_delete_metric,
+ const base::FilePath& profile_path);
+
+ void SetIsUserManagerDisplayed(bool displayed);
+
+ Profile* profile_;
+ bool is_user_manager_displayed = true;
+};
+
+#endif // CHROME_BROWSER_SIGNIN_FORCE_SIGNIN_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698