OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 "content/app/android/user_agent.h" | |
6 | |
7 #include "base/android/jni_android.h" | |
8 #include "base/android/jni_string.h" | |
9 #include "base/android/scoped_java_ref.h" | |
10 #include "jni/UserAgent_jni.h" | |
11 | |
12 using base::android::AttachCurrentThread; | |
13 using base::android::ScopedJavaLocalRef; | |
14 using base::android::ConvertJavaStringToUTF8; | |
15 using base::android::GetApplicationContext; | |
16 | |
17 namespace content { | |
18 | |
19 std::string GetUserAgentOSInfo() { | |
20 JNIEnv* env = AttachCurrentThread(); | |
21 ScopedJavaLocalRef<jstring> os_info = | |
22 Java_UserAgent_getUserAgentOSInfo(env); | |
23 return ConvertJavaStringToUTF8(os_info); | |
24 } | |
25 | |
26 bool RegisterUserAgent(JNIEnv* env) { | |
27 return RegisterNativesImpl(env); | |
28 } | |
29 | |
30 } // namespace content | |
OLD | NEW |