OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Set LoginUtils singleton object for test purpose only! | 47 // Set LoginUtils singleton object for test purpose only! |
48 static void Set(LoginUtils* ptr); | 48 static void Set(LoginUtils* ptr); |
49 | 49 |
50 // Checks if the given username is whitelisted and allowed to sign-in to | 50 // Checks if the given username is whitelisted and allowed to sign-in to |
51 // this device. |wildcard_match| may be NULL. If it's present, it'll be set to | 51 // this device. |wildcard_match| may be NULL. If it's present, it'll be set to |
52 // true if the whitelist check was satisfied via a wildcard. | 52 // true if the whitelist check was satisfied via a wildcard. |
53 static bool IsWhitelisted(const std::string& username, bool* wildcard_match); | 53 static bool IsWhitelisted(const std::string& username, bool* wildcard_match); |
54 | 54 |
55 virtual ~LoginUtils() {} | 55 virtual ~LoginUtils() {} |
56 | 56 |
57 // Switch to the locale that |profile| wishes to use and invoke |callback|. | |
58 virtual void RespectLocalePreference(Profile* profile, | |
59 const base::Closure& callback) = 0; | |
60 | |
61 // Thin wrapper around StartupBrowserCreator::LaunchBrowser(). Meant to be | 57 // Thin wrapper around StartupBrowserCreator::LaunchBrowser(). Meant to be |
62 // used in a Task posted to the UI thread. Once the browser is launched the | 58 // used in a Task posted to the UI thread. Once the browser is launched the |
63 // login host is deleted. | 59 // login host is deleted. |
64 virtual void DoBrowserLaunch(Profile* profile, | 60 virtual void DoBrowserLaunch(Profile* profile, |
65 LoginDisplayHost* login_host) = 0; | 61 LoginDisplayHost* login_host) = 0; |
66 | 62 |
67 // Loads and prepares profile for the session. Fires |delegate| in the end. | 63 // Loads and prepares profile for the session. Fires |delegate| in the end. |
68 // |user_context.username_hash| defines when user homedir is mounted. | 64 // |user_context.username_hash| defines when user homedir is mounted. |
69 // Also see DelegateDeleted method. | 65 // Also see DelegateDeleted method. |
70 // If |has_active_session| is true than this is a case of restoring user | 66 // If |has_active_session| is true than this is a case of restoring user |
(...skipping 30 matching lines...) Expand all Loading... |
101 // Might not return if restart is possible right now. | 97 // Might not return if restart is possible right now. |
102 // Returns true if restart was scheduled. | 98 // Returns true if restart was scheduled. |
103 // Returns false if no restart is needed, | 99 // Returns false if no restart is needed, |
104 virtual bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, | 100 virtual bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile, |
105 bool early_restart) = 0; | 101 bool early_restart) = 0; |
106 }; | 102 }; |
107 | 103 |
108 } // namespace chromeos | 104 } // namespace chromeos |
109 | 105 |
110 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ | 106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_UTILS_H_ |
OLD | NEW |