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

Side by Side Diff: content/app/android/user_agent.cc

Issue 10832235: Move Android user agent generation to native code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nit fix Created 8 years, 4 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
« no previous file with comments | « content/app/android/user_agent.h ('k') | content/content_app.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « content/app/android/user_agent.h ('k') | content/content_app.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698