Chromium Code Reviews| Index: chrome/browser/ui/views/profiles/force_signout_dialog.h |
| diff --git a/chrome/browser/ui/views/profiles/force_signout_dialog.h b/chrome/browser/ui/views/profiles/force_signout_dialog.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0de6438a3d401c898a93ece0200282cc11733abb |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/profiles/force_signout_dialog.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2017 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_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
| + |
| +#include <string> |
| + |
| +#include "components/app_modal/app_modal_dialog.h" |
| + |
| +namespace app_modal { |
| +class NativeAppModalDialog; |
| +} // namespace app_modal |
| + |
| +class Browser; |
| +class ForceSignoutTimer; |
| +class Profile; |
| +class SigninManager; |
| + |
| +// A app modal dialog that display the warning message of the auth failure |
|
sky
2017/05/04 03:45:11
An app modal dialog that displays a warning messag
zmin
2017/05/04 23:13:52
Done.
|
| +// before signing out user and closing browser window. |
| +class ForceSignoutDialog : public app_modal::AppModalDialog { |
| + public: |
| + // Show the warning dialog on the browser window that is belonged to the |
| + // |profile|. Sign out the profile directly if there is no opened browser |
| + // window or tabs. |
| + // Sign out the profile if user confirmed the window or sign out the profile |
| + // with a delay if signout_timer is set. |
| + static void ShowDialog(Profile* profile, |
| + SigninManager* signin_manager, |
| + ForceSignoutTimer* signout_timer); |
| + void OnAccept(); |
| + void OnCancel(); |
| + std::string GetEmail(); |
| + // Return true if ForceSignoutTimer is set. |
| + bool IsDelayAllowed(); |
| + |
| + protected: |
| + app_modal::NativeAppModalDialog* CreateNativeDialog() override; |
| + |
| + private: |
| + ForceSignoutDialog(Browser* browser, |
| + SigninManager* signin_manager, |
| + ForceSignoutTimer* signout_timer); |
| + |
| + Browser* browser_; |
| + SigninManager* signin_manager_; |
| + ForceSignoutTimer* signout_timer_; |
| +}; |
|
sky
2017/05/04 03:45:11
DISALLOW...
zmin
2017/05/04 23:13:52
Done.
|
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |