| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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_CHROMEOS_CROS_LOGIN_LIBRARY_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/memory/singleton.h" | |
| 12 #include "third_party/cros/chromeos_login.h" | |
| 13 | |
| 14 namespace chromeos { | |
| 15 | |
| 16 // This interface defines the interaction with the ChromeOS login library APIs. | |
| 17 class LoginLibrary { | |
| 18 public: | |
| 19 virtual ~LoginLibrary(); | |
| 20 | |
| 21 virtual void Init() = 0; | |
| 22 | |
| 23 // Requests that the Upstart signal login-prompt-ready be emitted. | |
| 24 virtual void EmitLoginPromptReady() = 0; | |
| 25 | |
| 26 // Requests that the Upstart signal login-prompt-visible be emitted. This is | |
| 27 // currently used only with views-desktop or aura environments. In the normal | |
| 28 // environment, the chromeos-wm emits the signal. | |
| 29 virtual void EmitLoginPromptVisible() = 0; | |
| 30 | |
| 31 virtual void RequestRetrievePolicy(RetrievePolicyCallback callback, | |
| 32 void* delegate_string) = 0; | |
| 33 | |
| 34 virtual void RequestStorePolicy(const std::string& policy, | |
| 35 StorePolicyCallback callback, | |
| 36 void* delegate_bool) = 0; | |
| 37 | |
| 38 // Tells the session manager to start a logged-in session for the user | |
| 39 // |user_email|. |unique_id| is meant to be used when we have a non-human- | |
| 40 // readable unique identifier by which we distinguish users (to deal with | |
| 41 // potential email address changes over time). | |
| 42 virtual void StartSession(const std::string& user_email, | |
| 43 const std::string& unique_id /* unused */) = 0; | |
| 44 | |
| 45 // Tells the session manager to terminate the current logged-in session. | |
| 46 // In the event that we ever support multiple simultaneous user sessions, | |
| 47 // This will tell the session manager to terminate the session for the user | |
| 48 // indicated by |unique_id|. | |
| 49 virtual void StopSession(const std::string& unique_id /* unused */) = 0; | |
| 50 | |
| 51 // Restarts the Enterprise Daemon. | |
| 52 virtual void RestartEntd() = 0; | |
| 53 | |
| 54 // Restarts the job with specified command line string. | |
| 55 virtual void RestartJob(int pid, const std::string& command_line) = 0; | |
| 56 | |
| 57 // Factory function, creates a new instance and returns ownership. | |
| 58 // For normal usage, access the singleton via CrosLibrary::Get(). | |
| 59 static LoginLibrary* GetImpl(bool stub); | |
| 60 }; | |
| 61 | |
| 62 } // namespace chromeos | |
| 63 | |
| 64 #endif // CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ | |
| OLD | NEW |