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

Side by Side Diff: chrome/browser/search/one_google_bar/one_google_bar_fetcher_impl.h

Issue 2814753002: Local NTP: Introduce OneGoogleBarFetcher (Closed)
Patch Set: copy ctor Created 3 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 2017 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_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_IMPL_H_
6 #define CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_IMPL_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "base/optional.h"
13 #include "chrome/browser/search/one_google_bar/one_google_bar_fetcher.h"
14
15 class GoogleURLTracker;
16 class OAuth2TokenService;
17 class SigninManagerBase;
18
19 namespace net {
20 class URLFetcher;
21 class URLRequestContextGetter;
22 } // namespace net
23
24 struct OneGoogleBarData;
25
26 class OneGoogleBarFetcherImpl : public OneGoogleBarFetcher {
Marc Treib 2017/04/12 10:19:48 So far, this is the only implementation, but we'll
sfiera 2017/04/12 17:25:47 Acknowledged.
27 public:
28 OneGoogleBarFetcherImpl(SigninManagerBase* signin_manager,
29 OAuth2TokenService* token_service,
30 net::URLRequestContextGetter* request_context,
31 GoogleURLTracker* google_url_tracker);
32 ~OneGoogleBarFetcherImpl();
33
34 void Fetch(OneGoogleCallback callback) override;
35
36 private:
37 class AuthenticatedURLFetcher;
38
39 void IssueRequestIfNoneOngoing();
40
41 void FetchDone(const net::URLFetcher* source);
42
43 void Respond(const base::Optional<OneGoogleBarData>& data);
44
45 SigninManagerBase* signin_manager_;
46 OAuth2TokenService* token_service_;
47 net::URLRequestContextGetter* request_context_;
48 GoogleURLTracker* google_url_tracker_;
49
50 std::vector<OneGoogleCallback> callbacks_;
51 std::unique_ptr<AuthenticatedURLFetcher> pending_request_;
52
53 DISALLOW_COPY_AND_ASSIGN(OneGoogleBarFetcherImpl);
54 };
55
56 #endif // CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_FETCHER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698