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

Side by Side Diff: chrome/browser/chromeos/login/signin/oauth2_token_initializer.h

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

Powered by Google App Engine
This is Rietveld 408576698