OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 "components/devtools_bridge/android/apiary_client_factory.h" | |
6 | |
7 #include "base/android/jni_string.h" | |
8 #include "google_apis/google_api_keys.h" | |
9 #include "jni/ApiaryClientFactory_jni.h" | |
10 | |
11 using base::android::ConvertUTF8ToJavaString; | |
12 | |
13 namespace devtools_bridge { | |
14 namespace android { | |
15 | |
16 // static | |
17 bool ApiaryClientFactory::RegisterNatives(JNIEnv* env) { | |
18 return RegisterNativesImpl(env); | |
19 } | |
20 | |
21 // static | |
22 jstring GetAPIKey(JNIEnv* env, jobject jcaller) { | |
23 return ConvertUTF8ToJavaString(env, google_apis::GetAPIKey()).Release(); | |
24 } | |
25 | |
26 // static | |
27 jstring GetOAuthClientId(JNIEnv* env, jobject jcaller) { | |
28 return ConvertUTF8ToJavaString( | |
29 env, google_apis::GetOAuth2ClientID( | |
30 google_apis::OAuth2Client::CLIENT_MAIN)).Release(); | |
31 } | |
32 | |
33 // static | |
34 jstring GetOAuthClientSecret(JNIEnv* env, jobject jcaller) { | |
35 return ConvertUTF8ToJavaString( | |
36 env, google_apis::GetOAuth2ClientSecret( | |
37 google_apis::OAuth2Client::CLIENT_MAIN)).Release(); | |
38 } | |
39 | |
40 } // namespace android | |
41 } // namespace devtools_bridge | |
OLD | NEW |