1// Copyright 2014 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 5package org.chromium.chrome.browser; 6 7/** 8 * TODO(nileshagrawal): Rename this class to something more appropriate. 9 * Provides a way for java code to determine whether Chrome was built as an official build. 10 */ 11public class BrowserVersion { 12 /** 13 * Check if the browser was built as an "official" build. 14 */ 15 public static boolean isOfficialBuild() { 16 return nativeIsOfficialBuild(); 17 } 18 19 /** 20 * Only native code can see the OFFICIAL_BUILD flag; check it from there. This function is 21 * not handled by initialize() and is not available early in startup (before the native 22 * library has loaded). Calling it before that point will result in an exception. 23 */ 24 private static native boolean nativeIsOfficialBuild(); 25 26 /** 27 * Get the HTML for the terms of service to be displayed at first run. 28 */ 29 public static String getTermsOfServiceHtml() { 30 return nativeGetTermsOfServiceHtml(); 31 } 32 33 /** 34 * The terms of service are a native resource. 35 */ 36 private static native String nativeGetTermsOfServiceHtml(); 37} 38