Chromium Code Reviews| Index: chrome/browser/android/browser_version.cc |
| diff --git a/chrome/browser/android/browser_version.cc b/chrome/browser/android/browser_version.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..634af62c1eb55db36f3243a5f023251f35078d8f |
| --- /dev/null |
| +++ b/chrome/browser/android/browser_version.cc |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2011 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. |
| + |
| +#include "chrome/browser/android/browser_version.h" |
| + |
| +#include "base/android/jni_string.h" |
| +#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.
|
| +#include "grit/generated_resources.h" |
| +#include "grit/locale_settings.h" |
| +#include "jni/BrowserVersion_jni.h" |
| +#include "ui/base/l10n/l10n_util.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| + |
| +using base::android::ConvertUTF8ToJavaString; |
| + |
| +// 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.
|
| +// TODO(dfalcantara): If ContentView and Clank will always return the same |
| +// value for this, find a way to reuse the original. |
| +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.
|
| +#if defined(OFFICIAL_BUILD) |
| + return true; |
| +#else |
| + return false; |
| +#endif |
| +} |
| + |
| +static jstring GetTermsOfServiceHtml(JNIEnv* env, jclass /* clazz */) { |
| + return ConvertUTF8ToJavaString(env, |
| + l10n_util::GetStringUTF8(IDS_TERMS_HTML)).Release(); |
| +} |
| + |
| +static jstring GetTermsOfServiceString(JNIEnv* env, jclass /* clazz */) { |
| + return ConvertUTF8ToJavaString(env, |
| + l10n_util::GetStringUTF8(IDS_FIRSTRUN_TOS_EXPLANATION)).Release(); |
| +} |
| + |
| +bool RegisterBrowserVersion(JNIEnv* env) { |
| + return RegisterNativesImpl(env); |
| +} |