Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4551)

Unified Diff: chrome/browser/chromeos/cros/login_library.h

Issue 1142005: Mocks for all libcros elements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros/language_library.cc ('k') | chrome/browser/chromeos/cros/login_library.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/login_library.h
===================================================================
--- chrome/browser/chromeos/cros/login_library.h (revision 42341)
+++ chrome/browser/chromeos/cros/login_library.h (working copy)
@@ -12,41 +12,41 @@
namespace chromeos {
-// This class handles the interaction with the ChromeOS login library APIs.
-// Users can get an instance of this library class like this:
-// LoginLibrary::Get()
+// This interface defines the interaction with the ChromeOS login library APIs.
class LoginLibrary {
public:
- // If the libray fails to load the first time we check, we don't want to
- // keep trying to load the library. If it fails the first time, it fails.
- static bool tried_and_failed;
-
- // This gets the singleton LoginLibrary.
- static LoginLibrary* Get();
-
+ virtual ~LoginLibrary() {}
// Requests that the Upstart signal login-prompt-ready be emitted.
- bool EmitLoginPromptReady();
+ virtual bool EmitLoginPromptReady() = 0;
// Tells the session manager to start a logged-in session for the user
// |user_email|. |unique_id| is meant to be used when we have a non-human-
// readable unique identifier by which we distinguish users (to deal with
// potential email address changes over time).
- bool StartSession(const std::string& user_email,
- const std::string& unique_id /* unused */);
+ virtual bool StartSession(const std::string& user_email,
+ const std::string& unique_id /* unused */) = 0;
// Tells the session manager to terminate the current logged-in session.
// In the event that we ever support multiple simultaneous user sessions,
// This will tell the session manager to terminate the session for the user
// indicated by |unique_id|.
- bool StopSession(const std::string& unique_id /* unused */);
+ virtual bool StopSession(const std::string& unique_id /* unused */) = 0;
+};
- private:
- friend struct DefaultSingletonTraits<LoginLibrary>;
+// This class handles the interaction with the ChromeOS login library APIs.
+class LoginLibraryImpl : public LoginLibrary {
+ public:
+ LoginLibraryImpl() {}
+ virtual ~LoginLibraryImpl() {}
- LoginLibrary() {}
- ~LoginLibrary() {}
+ // LoginLibrary overrides.
+ virtual bool EmitLoginPromptReady();
+ virtual bool StartSession(const std::string& user_email,
+ const std::string& unique_id /* unused */);
+ virtual bool StopSession(const std::string& unique_id /* unused */);
- DISALLOW_COPY_AND_ASSIGN(LoginLibrary);
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LoginLibraryImpl);
};
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/cros/language_library.cc ('k') | chrome/browser/chromeos/cros/login_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698