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

Side by Side Diff: ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h

Issue 2940063004: Revert of Removes usage of signin APIs that return scoped_nsobjects. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698