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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/BrowserVersion.java

Issue 492843003: [Android] Upstream BrowserVersion.java and related native code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/android/browser_version.h » ('j') | chrome/browser/android/browser_version.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/BrowserVersion.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BrowserVersion.java b/chrome/android/java/src/org/chromium/chrome/browser/BrowserVersion.java
new file mode 100644
index 0000000000000000000000000000000000000000..786bf01c850e3def14bf6013442d3d0844568ef0
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BrowserVersion.java
@@ -0,0 +1,48 @@
+// 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.
+
+package org.chromium.chrome.browser;
+
+/**
+ * TODO(nileshagrawal): Rename this class to something more appropriate.
+ * Provides a way for java code to determine whether Clank was built as an official build.
Yaron 2014/08/20 19:11:48 Chrome
Feng Qian 2014/08/20 21:34:29 Done.
+ */
+public class BrowserVersion {
+ /**
+ * Check if the browser was built as an "official" build.
+ */
+ public static boolean isOfficialBuild() {
+ return nativeIsOfficialBuild();
+ }
+
+ /**
+ * Only native code can see the OFFICIAL_BUILD flag; check it from there. This function is
+ * not handled by initialize() and is not available early in startup (before the native
+ * library has loaded). Calling it before that point will result in an exception.
+ *
+ * TODO(dfalcantara): If/when we start using ProGuard, replace this JNI call with method
Yaron 2014/08/20 19:11:48 We do use proguard. What does this mean? It's prob
gone 2014/08/20 20:12:42 joth made me add this TODO forever ago. Probably
Feng Qian 2014/08/20 21:34:29 Done.
+ * reflection: http://b/issue?id=5364886
+ */
+ private static native boolean nativeIsOfficialBuild();
+
+ /**
+ * Get the HTML for the terms of service to be displayed at first run.
+ */
+ public static String getTermsOfServiceHtml() {
+ return nativeGetTermsOfServiceHtml();
+ }
+
+ /**
+ * Get the HTML for the terms of service to be displayed at first run.
+ */
+ public static String getTermsOfServiceString() {
Yaron 2014/08/20 19:11:48 I don't actually see where this is used. Please re
Feng Qian 2014/08/20 21:34:29 Done.
+ return nativeGetTermsOfServiceString();
+ }
+
+ /**
+ * The terms of service are a native resource.
+ */
+ private static native String nativeGetTermsOfServiceHtml();
+ private static native String nativeGetTermsOfServiceString();
+}
« no previous file with comments | « no previous file | chrome/browser/android/browser_version.h » ('j') | chrome/browser/android/browser_version.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698