| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICES_GCM_FAKE_SIGNIN_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_FAKE_SIGNIN_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SERVICES_GCM_FAKE_SIGNIN_MANAGER_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_FAKE_SIGNIN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/signin/core/browser/signin_metrics.h" |
| 11 | 12 |
| 12 #if defined(OS_CHROMEOS) | 13 #if defined(OS_CHROMEOS) |
| 13 #include "components/signin/core/browser/signin_manager_base.h" | 14 #include "components/signin/core/browser/signin_manager_base.h" |
| 14 #else | 15 #else |
| 15 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 16 #include "components/signin/core/browser/signin_manager.h" | 17 #include "components/signin/core/browser/signin_manager.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 class KeyedService; | 20 class KeyedService; |
| 20 class Profile; | 21 class Profile; |
| 21 | 22 |
| 22 namespace content { | 23 namespace content { |
| 23 class BrowserContext; | 24 class BrowserContext; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace gcm { | 27 namespace gcm { |
| 27 | 28 |
| 28 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 29 class FakeSigninManager : public SigninManagerBase { | 30 class FakeSigninManager : public SigninManagerBase { |
| 30 #else | 31 #else |
| 31 class FakeSigninManager : public SigninManager { | 32 class FakeSigninManager : public SigninManager { |
| 32 #endif | 33 #endif |
| 33 public: | 34 public: |
| 34 explicit FakeSigninManager(Profile* profile); | 35 explicit FakeSigninManager(Profile* profile); |
| 35 virtual ~FakeSigninManager(); | 36 virtual ~FakeSigninManager(); |
| 36 | 37 |
| 37 void SignIn(const std::string& username); | 38 void SignIn(const std::string& username); |
| 38 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
| 39 void SignOut(); | 40 void SignOut(signin_metrics::ProfileSignout signout_source_metric); |
| 40 #else | 41 #else |
| 41 virtual void SignOut() OVERRIDE; | 42 virtual void SignOut(signin_metrics::ProfileSignout signout_source_metric) |
| 43 OVERRIDE; |
| 42 #endif | 44 #endif |
| 43 | 45 |
| 44 static KeyedService* Build(content::BrowserContext* context); | 46 static KeyedService* Build(content::BrowserContext* context); |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 Profile* profile_; | 49 Profile* profile_; |
| 48 | 50 |
| 49 DISALLOW_COPY_AND_ASSIGN(FakeSigninManager); | 51 DISALLOW_COPY_AND_ASSIGN(FakeSigninManager); |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 } // namespace gcm | 54 } // namespace gcm |
| 53 | 55 |
| 54 #endif // CHROME_BROWSER_SERVICES_GCM_FAKE_SIGNIN_MANAGER_H_ | 56 #endif // CHROME_BROWSER_SERVICES_GCM_FAKE_SIGNIN_MANAGER_H_ |
| OLD | NEW |