OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 |
| 13 class ForceSignoutDialogView; |
| 14 class Profile; |
| 15 class SigninManager; |
| 16 |
| 17 // A modal dialog that displays a warning message of the auth failure |
| 18 // before signing the user out and closing browser windows. |
| 19 class ForceSignoutDialog { |
| 20 public: |
| 21 // Show the warning dialog on the browser window that is belonged to the |
| 22 // |profile|. Sign out the profile directly if there is no opened browser |
| 23 // window or tabs. |
| 24 // Sign out the profile if user confirmed the window or sign out the profile |
| 25 // with a delay if signout_timer is set. |
| 26 static void ShowDialog(Profile* profile, |
| 27 SigninManager* signin_manager, |
| 28 const base::Closure& signout_timer); |
| 29 |
| 30 // Activate the modal dialog. |
| 31 static void ActivateModalDialog(); |
| 32 |
| 33 // Return true if modal dialog is visible. |
| 34 static bool IsShowing(); |
| 35 |
| 36 // Return true if SignoutTimer is set. |
| 37 bool IsDelayAllowed(); |
| 38 void OnAccept(); |
| 39 void OnCancel(); |
| 40 std::string GetEmail(); |
| 41 void OnViewClosing(); |
| 42 |
| 43 ForceSignoutDialog(SigninManager* signin_manager, |
| 44 const base::Closure& signout_timer); |
| 45 ~ForceSignoutDialog(); |
| 46 |
| 47 static ForceSignoutDialogView* GetDialogViewForTesting(); |
| 48 |
| 49 private: |
| 50 SigninManager* signin_manager_; |
| 51 const base::Closure signout_timer_; |
| 52 |
| 53 static ForceSignoutDialogView* dialog_view_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(ForceSignoutDialog); |
| 56 }; |
| 57 |
| 58 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_FORCE_SIGNOUT_DIALOG_H_ |
OLD | NEW |