Chromium Code Reviews| 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_ |