Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / chrome / android / java / src / org / chromium / chrome / browser / ChromeVersionInfo.java
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
5 package org.chromium.chrome.browser;
6
7 /**
8  * A utility class for querying information about the current Chrome build.
9  * Intentionally doesn't depend on native so that the data can be accessed before
10  * libchrome.so is loaded.
11  */
12 public class ChromeVersionInfo {
13     /**
14      * @return Whether this build is a local build.
15      */
16     public static boolean isLocalBuild() {
17         return ChromeVersionConstants.CHANNEL == ChromeVersionConstants.CHANNEL_DEFAULT;
18     }
19
20     /**
21      * @return Whether this build is a canary build.
22      */
23     public static boolean isCanaryBuild() {
24         return ChromeVersionConstants.CHANNEL == ChromeVersionConstants.CHANNEL_CANARY;
25     }
26
27     /**
28      * @return Whether this build is a dev build.
29      */
30     public static boolean isDevBuild() {
31         return ChromeVersionConstants.CHANNEL == ChromeVersionConstants.CHANNEL_DEV;
32     }
33
34     /**
35      * @return Whether this build is a beta build.
36      */
37     public static boolean isBetaBuild() {
38         return ChromeVersionConstants.CHANNEL == ChromeVersionConstants.CHANNEL_BETA;
39     }
40
41     /**
42      * @return Whether this build is a stable build.
43      */
44     public static boolean isStableBuild() {
45         return ChromeVersionConstants.CHANNEL == ChromeVersionConstants.CHANNEL_STABLE;
46     }
47
48     /**
49      * @return Whether this is an official (i.e. Google Chrome) build.
50      */
51     public static boolean isOfficialBuild() {
52         return ChromeVersionConstants.IS_OFFICIAL_BUILD;
53     }
54 }