| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_FAKE_CHROME_IDENTITY_SERVICE_H
_ | 5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_FAKE_CHROME_IDENTITY_SERVICE_H
_ |
| 6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_FAKE_CHROME_IDENTITY_SERVICE_H
_ | 6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_FAKE_CHROME_IDENTITY_SERVICE_H
_ |
| 7 | 7 |
| 8 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" | 8 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 | 12 |
| 13 @class NSMutableArray; | 13 @class NSMutableArray; |
| 14 | 14 |
| 15 namespace ios { | 15 namespace ios { |
| 16 | 16 |
| 17 // A fake ChromeIdentityService used for testing. | 17 // A fake ChromeIdentityService used for testing. |
| 18 class FakeChromeIdentityService : public ChromeIdentityService { | 18 class FakeChromeIdentityService : public ChromeIdentityService { |
| 19 public: | 19 public: |
| 20 FakeChromeIdentityService(); | 20 FakeChromeIdentityService(); |
| 21 virtual ~FakeChromeIdentityService(); | 21 virtual ~FakeChromeIdentityService(); |
| 22 | 22 |
| 23 // Convenience method that returns the instance of | 23 // Convenience method that returns the instance of |
| 24 // |FakeChromeIdentityService| from the ChromeBrowserProvider. | 24 // |FakeChromeIdentityService| from the ChromeBrowserProvider. |
| 25 static FakeChromeIdentityService* GetInstanceFromChromeProvider(); | 25 static FakeChromeIdentityService* GetInstanceFromChromeProvider(); |
| 26 | 26 |
| 27 // ChromeIdentityService implementation. | 27 // ChromeIdentityService implementation. |
| 28 UINavigationController* CreateAccountDetailsController( | 28 base::scoped_nsobject<UINavigationController> NewAccountDetails( |
| 29 ChromeIdentity* identity, | 29 ChromeIdentity* identity, |
| 30 id<ChromeIdentityBrowserOpener> browser_opener) override; | 30 id<ChromeIdentityBrowserOpener> browser_opener) override; |
| 31 ChromeIdentityInteractionManager* CreateChromeIdentityInteractionManager( | 31 base::scoped_nsobject<ChromeIdentityInteractionManager> |
| 32 NewChromeIdentityInteractionManager( |
| 32 ios::ChromeBrowserState* browser_state, | 33 ios::ChromeBrowserState* browser_state, |
| 33 id<ChromeIdentityInteractionManagerDelegate> delegate) const override; | 34 id<ChromeIdentityInteractionManagerDelegate> delegate) const override; |
| 34 | 35 |
| 35 bool IsValidIdentity(ChromeIdentity* identity) const override; | 36 bool IsValidIdentity(ChromeIdentity* identity) const override; |
| 36 ChromeIdentity* GetIdentityWithGaiaID( | 37 ChromeIdentity* GetIdentityWithGaiaID( |
| 37 const std::string& gaia_id) const override; | 38 const std::string& gaia_id) const override; |
| 38 bool HasIdentities() const override; | 39 bool HasIdentities() const override; |
| 39 NSArray* GetAllIdentities() const override; | 40 NSArray* GetAllIdentities() const override; |
| 40 NSArray* GetAllIdentitiesSortedForDisplay() const override; | 41 NSArray* GetAllIdentitiesSortedForDisplay() const override; |
| 41 void ForgetIdentity(ChromeIdentity* identity, | 42 void ForgetIdentity(ChromeIdentity* identity, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // is unknown. | 80 // is unknown. |
| 80 void RemoveIdentity(ChromeIdentity* identity); | 81 void RemoveIdentity(ChromeIdentity* identity); |
| 81 | 82 |
| 82 private: | 83 private: |
| 83 base::scoped_nsobject<NSMutableArray> identities_; | 84 base::scoped_nsobject<NSMutableArray> identities_; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace ios | 87 } // namespace ios |
| 87 | 88 |
| 88 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_FAKE_CHROME_IDENTITY_SERVIC
E_H_ | 89 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_FAKE_CHROME_IDENTITY_SERVIC
E_H_ |
| OLD | NEW |