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

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

Issue 1075273002: Handle ListAccount fetches from within the GaiaCookieManagerService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/signin/fake_gaia_cookie_manager_service.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/chrome_signin_client_factory.h"
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
10 #include "components/signin/core/browser/profile_oauth2_token_service.h"
11 #include "google_apis/gaia/gaia_constants.h"
12 #include "google_apis/gaia/gaia_urls.h"
13
14 FakeGaiaCookieManagerService::FakeGaiaCookieManagerService(
15 OAuth2TokenService* token_service,
16 const std::string& source,
17 SigninClient* client) :
18 GaiaCookieManagerService(token_service, source, client),
19 url_fetcher_factory_(NULL) {
20 url_fetcher_factory_.SetFakeResponse(
21 GaiaUrls::GetInstance()->ListAccountsURLWithSource(
22 GaiaConstants::kChromeSource),
23 "[\"f\", []]",
24 net::HTTP_OK,
25 net::URLRequestStatus::SUCCESS);
Roger Tawa OOO till Jul 10th 2015/04/15 18:51:05 I think you can wrap lines 20-25 in a static helpe
Mike Lerman 2015/04/16 13:13:46 Discussed offline - adding helper methods to prepa
26 }
27
28 // static
29 KeyedService* FakeGaiaCookieManagerService::Build(
30 content::BrowserContext* context) {
31 Profile* profile = Profile::FromBrowserContext(context);
32 GaiaCookieManagerService* service = new GaiaCookieManagerService(
33 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
34 GaiaConstants::kChromeSource,
35 ChromeSigninClientFactory::GetForProfile(profile));
36 return service;
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698