Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2011 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 "chrome/browser/android/browser_version.h" | |
| 6 | |
| 7 #include "base/android/jni_string.h" | |
| 8 #include "base/logging.h" | |
|
Lei Zhang
2014/08/20 19:25:06
logging.h and resource_bundle.h are probably not n
Feng Qian
2014/08/20 21:34:29
Done.
| |
| 9 #include "grit/generated_resources.h" | |
| 10 #include "grit/locale_settings.h" | |
| 11 #include "jni/BrowserVersion_jni.h" | |
| 12 #include "ui/base/l10n/l10n_util.h" | |
| 13 #include "ui/base/resource/resource_bundle.h" | |
| 14 | |
| 15 using base::android::ConvertUTF8ToJavaString; | |
| 16 | |
| 17 // This mimics the functionality in ContentView's browser_process_main.cc. | |
|
Yaron
2014/08/20 19:11:48
This whole comment looks historical, please remove
Feng Qian
2014/08/20 21:34:29
Done.
| |
| 18 // TODO(dfalcantara): If ContentView and Clank will always return the same | |
| 19 // value for this, find a way to reuse the original. | |
| 20 static jboolean IsOfficialBuild(JNIEnv* env, jclass /* clazz */) { | |
|
Lei Zhang
2014/08/20 19:25:06
Just call chrome::VersionInfo().IsOfficialBuild()
Feng Qian
2014/08/20 21:34:29
Done.
| |
| 21 #if defined(OFFICIAL_BUILD) | |
| 22 return true; | |
| 23 #else | |
| 24 return false; | |
| 25 #endif | |
| 26 } | |
| 27 | |
| 28 static jstring GetTermsOfServiceHtml(JNIEnv* env, jclass /* clazz */) { | |
| 29 return ConvertUTF8ToJavaString(env, | |
| 30 l10n_util::GetStringUTF8(IDS_TERMS_HTML)).Release(); | |
| 31 } | |
| 32 | |
| 33 static jstring GetTermsOfServiceString(JNIEnv* env, jclass /* clazz */) { | |
| 34 return ConvertUTF8ToJavaString(env, | |
| 35 l10n_util::GetStringUTF8(IDS_FIRSTRUN_TOS_EXPLANATION)).Release(); | |
| 36 } | |
| 37 | |
| 38 bool RegisterBrowserVersion(JNIEnv* env) { | |
| 39 return RegisterNativesImpl(env); | |
| 40 } | |
| OLD | NEW |