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

Side by Side Diff: chrome/browser/signin/fake_gaia_cookie_manager_service.h

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_ 4 #ifndef CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
5 #define CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_ 5 #define CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
6 6
7 #include "components/signin/core/browser/gaia_cookie_manager_service.h" 7 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
8 8
9 #include "base/memory/scoped_ptr.h"
9 #include "net/url_request/test_url_fetcher_factory.h" 10 #include "net/url_request/test_url_fetcher_factory.h"
10 11
11 namespace content { 12 namespace content {
12 class BrowserContext; 13 class BrowserContext;
13 } 14 }
14 15
15 class FakeGaiaCookieManagerService : public GaiaCookieManagerService { 16 class FakeGaiaCookieManagerService : public GaiaCookieManagerService {
16 public: 17 public:
17 FakeGaiaCookieManagerService(OAuth2TokenService* token_service, 18 FakeGaiaCookieManagerService(OAuth2TokenService* token_service,
18 const std::string& source, 19 const std::string& source,
19 SigninClient* client); 20 SigninClient* client);
20 21
21 void Init(net::FakeURLFetcherFactory* url_fetcher_factory); 22 void Init(net::FakeURLFetcherFactory* url_fetcher_factory);
22 23
23 void SetListAccountsResponseHttpNotFound(); 24 void SetListAccountsResponseHttpNotFound();
24 void SetListAccountsResponseWebLoginRequired(); 25 void SetListAccountsResponseWebLoginRequired();
25 void SetListAccountsResponseNoAccounts(); 26 void SetListAccountsResponseNoAccounts();
26 void SetListAccountsResponseOneAccount(const char* account); 27 void SetListAccountsResponseOneAccount(const char* account);
27 void SetListAccountsResponseOneAccountWithExpiry( 28 void SetListAccountsResponseOneAccountWithExpiry(
28 const char* account, bool expired); 29 const char* account, bool expired);
29 void SetListAccountsResponseTwoAccounts(const char* account1, 30 void SetListAccountsResponseTwoAccounts(const char* account1,
30 const char* account2); 31 const char* account2);
31 void SetListAccountsResponseTwoAccountsWithExpiry( 32 void SetListAccountsResponseTwoAccountsWithExpiry(
32 const char* account1, bool account1_expired, 33 const char* account1, bool account1_expired,
33 const char* account2, bool account2_expired); 34 const char* account2, bool account2_expired);
34 35
35 // Helper function to be used with KeyedService::SetTestingFactory(). 36 // Helper function to be used with KeyedService::SetTestingFactory().
36 static KeyedService* Build(content::BrowserContext* context); 37 static scoped_ptr<KeyedService> Build(content::BrowserContext* context);
37 38
38 private: 39 private:
39 // Provide a fake response for calls to /ListAccounts. 40 // Provide a fake response for calls to /ListAccounts.
40 net::FakeURLFetcherFactory* url_fetcher_factory_; 41 net::FakeURLFetcherFactory* url_fetcher_factory_;
41 42
42 DISALLOW_COPY_AND_ASSIGN(FakeGaiaCookieManagerService); 43 DISALLOW_COPY_AND_ASSIGN(FakeGaiaCookieManagerService);
43 }; 44 };
44 45
45 #endif // CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_ 46 #endif // CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698