Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / android / feature_utilities.cc
blob23111c678d8a819788aecff9e007fa7b2c1cbbcb
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.
5 #include "chrome/browser/android/feature_utilities.h"
7 #include "jni/FeatureUtilities_jni.h"
9 namespace {
10 bool document_mode_enabled = false;
11 bool custom_tab_visible = false;
12 } // namespace
14 namespace chrome {
15 namespace android {
17 RunningModeHistogram GetDocumentModeValue() {
18 return document_mode_enabled ? RUNNING_MODE_DOCUMENT_MODE :
19 RUNNING_MODE_TABBED_MODE;
22 CustomTabsVisibilityHistogram GetCustomTabsVisibleValue() {
23 return custom_tab_visible ? VISIBLE_CUSTOM_TAB :
24 VISIBLE_CHROME_TAB;
27 } // namespace android
28 } // namespace chrome
30 static void SetDocumentModeEnabled(JNIEnv* env,
31 const JavaParamRef<jclass>& clazz,
32 jboolean enabled) {
33 document_mode_enabled = enabled;
36 static void SetCustomTabVisible(JNIEnv* env,
37 const JavaParamRef<jclass>& clazz,
38 jboolean visible) {
39 custom_tab_visible = visible;
42 bool RegisterFeatureUtilities(JNIEnv* env) {
43 return RegisterNativesImpl(env);