forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogle_account_access_token_fetcher_proxy.h
46 lines (35 loc) · 1.64 KB
/
google_account_access_token_fetcher_proxy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_BROWSER_GOOGLE_ACCOUNT_ACCESS_TOKEN_FETCHER_PROXY_H_
#define WEBLAYER_BROWSER_GOOGLE_ACCOUNT_ACCESS_TOKEN_FETCHER_PROXY_H_
#include <jni.h>
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
#include "weblayer/public/google_account_access_token_fetch_delegate.h"
namespace weblayer {
class Profile;
// Forwards GoogleAccountAccessTokenFetchDelegate calls to the java-side
// GoogleAccountAccessTokenFetcherProxy.
class GoogleAccountAccessTokenFetcherProxy
: public GoogleAccountAccessTokenFetchDelegate {
public:
GoogleAccountAccessTokenFetcherProxy(JNIEnv* env,
jobject obj,
Profile* profile);
~GoogleAccountAccessTokenFetcherProxy() override;
GoogleAccountAccessTokenFetcherProxy(
const GoogleAccountAccessTokenFetcherProxy&) = delete;
GoogleAccountAccessTokenFetcherProxy& operator=(
const GoogleAccountAccessTokenFetcherProxy&) = delete;
// GoogleAccountAccessTokenFetchDelegate:
void FetchAccessToken(const std::set<std::string>& scopes,
OnTokenFetchedCallback callback) override;
void OnAccessTokenIdentifiedAsInvalid(const std::set<std::string>& scopes,
const std::string& token) override;
private:
base::android::ScopedJavaGlobalRef<jobject> java_delegate_;
Profile* profile_;
};
} // namespace weblayer
#endif // WEBLAYER_BROWSER_GOOGLE_ACCOUNT_ACCESS_TOKEN_FETCHER_PROXY_H_