Chromium Code Reviews| Index: chrome/browser/android/metrics/VariationsSession.java |
| diff --git a/chrome/browser/android/metrics/VariationsSession.java b/chrome/browser/android/metrics/VariationsSession.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f8df0f0e6fe4e8a1f0272b73a17e8dc05a3ead3d |
| --- /dev/null |
| +++ b/chrome/browser/android/metrics/VariationsSession.java |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2014 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 com.google.android.apps.chrome.variations; |
| + |
| +import android.content.Context; |
| + |
| +/** |
| + * Sets up communication with the VariationsService. This is primarily used for |
| + * triggering seed fetches on application startup. |
| + */ |
| +public class VariationsSession { |
|
Yaron
2015/03/23 14:39:44
You don't want this one. Only the one in the other
|
| + private boolean mInitialized; |
| + private String mRestrictMode; |
| + |
| + /** |
| + * Triggers to the native VariationsService that the application has entered the foreground. |
| + */ |
| + public void start(Context context) { |
| + if (!mInitialized) { |
| + mInitialized = true; |
| + // Check the restrict mode only once initially to avoid doing extra work each time the |
| + // app enters foreground. |
| + mRestrictMode = getRestrictMode(context); |
| + } |
| + nativeStartVariationsSession(mRestrictMode); |
| + } |
| + |
| + /** |
| + * Returns the value of the "restrict" URL param that the variations service should use for |
| + * variation seed requests. |
| + */ |
| + protected String getRestrictMode(Context context) { |
| + return ""; |
| + } |
| + |
| + private native void nativeStartVariationsSession(String restrictMode); |
| +} |