Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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.components.feature_engagement_tracker; | |
| 6 | |
| 7 import android.support.annotation.CheckResult; | |
| 8 | |
| 9 import org.chromium.base.Callback; | |
| 10 | |
| 11 /** | |
| 12 * FeatureEngagementTracker is the Java representation of a native FeatureEngage mentTracker object. | |
| 13 * It is owned by the native BrowserContext. | |
| 14 * | |
| 15 * FeatureEngagementTracker is the core class for the feature engagement tracker . | |
| 16 */ | |
| 17 public interface FeatureEngagementTracker { | |
| 18 /** | |
| 19 * Must be called whenever an event related to a precondition happens. | |
| 20 */ | |
| 21 void event(String feature, String precondition); | |
| 22 | |
| 23 /** | |
| 24 * Must be called whenever a feature has been used. | |
| 25 */ | |
| 26 void used(String feature); | |
| 27 | |
| 28 /** | |
| 29 * This function must be called whenever the triggering condition for a | |
| 30 * specific feature happens. Returns true iff the display of feature | |
| 31 * enlightenment must happen. | |
| 32 * If |true| is returned, the caller *must* call dismissed() when display | |
|
David Trainor- moved to gerrit
2017/03/29 18:00:06
{@code true}? Also use javadoc style "@return {@c
nyquist
2017/03/30 22:58:54
Done.
| |
| 33 * of feature enlightenment ends. | |
| 34 */ | |
| 35 @CheckResult | |
| 36 boolean trigger(String feature); | |
| 37 | |
| 38 /** | |
| 39 * Must be called after display of feature enlightenment finishes. | |
| 40 */ | |
| 41 void dismissed(); | |
| 42 | |
| 43 /** | |
| 44 * For features that trigger on startup, they register a callback to ensure that they are told | |
| 45 * when the tracker has been initialized. The callback will be invoked when the tracker has | |
|
David Trainor- moved to gerrit
2017/03/29 18:00:06
Maybe not required for the comment, but the callba
nyquist
2017/03/30 22:58:54
It will be invoked after the DB has been invoked.
| |
| 46 * been initialized. The boolean parameter indicated whether the initializat ion was a success | |
| 47 * and that the tracker is ready to receive calls. | |
| 48 */ | |
| 49 void addOnInitializedCallback(Callback<Boolean> callback); | |
| 50 } | |
| OLD | NEW |