| Index: chrome/browser/chromeos/cros/login_library.cc
|
| diff --git a/chrome/browser/chromeos/cros/login_library.cc b/chrome/browser/chromeos/cros/login_library.cc
|
| index efd8536a7afae579391d92491e9aa22860e380a5..341cf597faa1df5622097a9f53b556e0d4eddecc 100644
|
| --- a/chrome/browser/chromeos/cros/login_library.cc
|
| +++ b/chrome/browser/chromeos/cros/login_library.cc
|
| @@ -10,19 +10,50 @@
|
|
|
| namespace chromeos {
|
|
|
| -bool LoginLibraryImpl::EmitLoginPromptReady() {
|
| - return chromeos::EmitLoginPromptReady();
|
| -}
|
| +class LoginLibraryImpl : public LoginLibrary {
|
| + public:
|
| + LoginLibraryImpl() {}
|
| + virtual ~LoginLibraryImpl() {}
|
|
|
| -bool LoginLibraryImpl::StartSession(const std::string& user_email,
|
| - const std::string& unique_id /* unused */) {
|
| - // only pass unique_id through once we use it for something.
|
| - return chromeos::StartSession(user_email.c_str(), "");
|
| -}
|
| + bool EmitLoginPromptReady() {
|
| + return chromeos::EmitLoginPromptReady();
|
| + }
|
| +
|
| + bool StartSession(const std::string& user_email,
|
| + const std::string& unique_id /* unused */) {
|
| + // only pass unique_id through once we use it for something.
|
| + return chromeos::StartSession(user_email.c_str(), "");
|
| + }
|
| +
|
| + bool StopSession(const std::string& unique_id /* unused */) {
|
| + // only pass unique_id through once we use it for something.
|
| + return chromeos::StopSession("");
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(LoginLibraryImpl);
|
| +};
|
| +
|
| +class LoginLibraryStubImpl : public LoginLibrary {
|
| + public:
|
| + LoginLibraryStubImpl() {}
|
| + virtual ~LoginLibraryStubImpl() {}
|
| +
|
| + bool EmitLoginPromptReady() { return true; }
|
| + bool StartSession(const std::string& user_email,
|
| + const std::string& unique_id /* unused */) { return true; }
|
| + bool StopSession(const std::string& unique_id /* unused */) { return true; }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(LoginLibraryStubImpl);
|
| +};
|
|
|
| -bool LoginLibraryImpl::StopSession(const std::string& unique_id /* unused */) {
|
| - // only pass unique_id through once we use it for something.
|
| - return chromeos::StopSession("");
|
| +// static
|
| +LoginLibrary* LoginLibrary::GetImpl(bool stub) {
|
| + if (stub)
|
| + return new LoginLibraryStubImpl();
|
| + else
|
| + return new LoginLibraryImpl();
|
| }
|
|
|
| } // namespace chromeos
|
|
|