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/chromeos/login/signin/oauth2_token_initializer.h

Issue 1097663003: Fetch OAuth2 tokens prior to profile creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set up default networks 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_OAUTH2_TOKEN_INITIALIZER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_OAUTH2_TOKEN_INITIALIZER_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/chromeos/login/signin/oauth2_token_fetcher.h"
14 #include "chromeos/login/auth/user_context.h"
15
16 namespace chromeos {
17
18 // Performs initial fetch of OAuth2 Tokens.
19 class OAuth2TokenInitializer final : public OAuth2TokenFetcher::Delegate {
20 public:
21 // Callback to be invoked after initialization is done.
22 using FetchOAuth2TokensCallback =
23 base::Callback<void(bool success, const UserContext& user_context)>;
24
25 OAuth2TokenInitializer();
26 ~OAuth2TokenInitializer() override;
27
28 // Fetch OAuth2 tokens.
29 void Start(const UserContext& context,
30 const FetchOAuth2TokensCallback& callback);
31
32 private:
33 // OAuth2TokenFetcher::Delegate overrides.
34 void OnOAuth2TokensAvailable(
35 const GaiaAuthConsumer::ClientOAuthResult& oauth2_tokens) override;
36 void OnOAuth2TokensFetchFailed() override;
37
38 UserContext user_context_;
39 FetchOAuth2TokensCallback callback_;
40 scoped_ptr<OAuth2TokenFetcher> oauth2_token_fetcher_;
41
42 DISALLOW_COPY_AND_ASSIGN(OAuth2TokenInitializer);
43 };
44
45 } // namespace chromeos
46
47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_OAUTH2_TOKEN_INITIALIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698