Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java

Issue 2790183002: Add UMA for the content suggestions settings (Closed)
Patch Set: address comments and rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.ntp.snippets; 5 package org.chromium.chrome.browser.ntp.snippets;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 8
9 import org.chromium.base.Callback; 9 import org.chromium.base.Callback;
10 import org.chromium.base.annotations.CalledByNative; 10 import org.chromium.base.annotations.CalledByNative;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 nativeRemoteSuggestionsSchedulerRescheduleFetching(); 81 nativeRemoteSuggestionsSchedulerRescheduleFetching();
82 } 82 }
83 83
84 /** 84 /**
85 * Fetches remote suggestions in background. 85 * Fetches remote suggestions in background.
86 */ 86 */
87 public static void fetchRemoteSuggestionsFromBackground() { 87 public static void fetchRemoteSuggestionsFromBackground() {
88 nativeRemoteSuggestionsSchedulerOnFetchDue(); 88 nativeRemoteSuggestionsSchedulerOnFetchDue();
89 } 89 }
90 90
91 public static void setRemoteSuggestionsServiceEnabled(boolean enabled) { 91 public static void setRemoteSuggestionsEnabled(boolean enabled) {
92 nativeSetRemoteSuggestionsServiceEnabled(enabled); 92 nativeSetRemoteSuggestionsEnabled(enabled);
93 } 93 }
94 94
95 public static boolean isRemoteSuggestionsServiceEnabled() { 95 public static boolean areRemoteSuggestionsEnabled() {
96 return nativeIsRemoteSuggestionsServiceEnabled(); 96 return nativeAreRemoteSuggestionsEnabled();
97 } 97 }
98 98
99 public static boolean isRemoteSuggestionsServiceManaged() { 99 public static boolean areRemoteSuggestionsManaged() {
100 return nativeIsRemoteSuggestionsServiceManaged(); 100 return nativeAreRemoteSuggestionsManaged();
101 } 101 }
102 102
103 public static boolean isRemoteSuggestionsServiceManagedByCustodian() { 103 public static boolean areRemoteSuggestionsManagedByCustodian() {
104 return nativeIsRemoteSuggestionsServiceManagedByCustodian(); 104 return nativeAreRemoteSuggestionsManagedByCustodian();
105 } 105 }
106 106
107 public static void setContentSuggestionsNotificationsEnabled(boolean enabled ) { 107 public static void setContentSuggestionsNotificationsEnabled(boolean enabled ) {
108 nativeSetContentSuggestionsNotificationsEnabled(enabled); 108 nativeSetContentSuggestionsNotificationsEnabled(enabled);
109 } 109 }
110 110
111 public static boolean areContentSuggestionsNotificationsEnabled() { 111 public static boolean areContentSuggestionsNotificationsEnabled() {
112 return nativeAreContentSuggestionsNotificationsEnabled(); 112 return nativeAreContentSuggestionsNotificationsEnabled();
113 } 113 }
114 114
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 @CalledByNative 354 @CalledByNative
355 private void onFullRefreshRequired() { 355 private void onFullRefreshRequired() {
356 if (mObserver != null) mObserver.onFullRefreshRequired(); 356 if (mObserver != null) mObserver.onFullRefreshRequired();
357 } 357 }
358 358
359 private native long nativeInit(Profile profile); 359 private native long nativeInit(Profile profile);
360 private native void nativeDestroy(long nativeNTPSnippetsBridge); 360 private native void nativeDestroy(long nativeNTPSnippetsBridge);
361 private native void nativeReloadSuggestions(long nativeNTPSnippetsBridge); 361 private native void nativeReloadSuggestions(long nativeNTPSnippetsBridge);
362 private static native void nativeRemoteSuggestionsSchedulerOnFetchDue(); 362 private static native void nativeRemoteSuggestionsSchedulerOnFetchDue();
363 private static native void nativeRemoteSuggestionsSchedulerRescheduleFetchin g(); 363 private static native void nativeRemoteSuggestionsSchedulerRescheduleFetchin g();
364 private static native void nativeSetRemoteSuggestionsServiceEnabled(boolean enabled); 364 private static native void nativeSetRemoteSuggestionsEnabled(boolean enabled );
365 private static native boolean nativeIsRemoteSuggestionsServiceEnabled(); 365 private static native boolean nativeAreRemoteSuggestionsEnabled();
366 private static native boolean nativeIsRemoteSuggestionsServiceManaged(); 366 private static native boolean nativeAreRemoteSuggestionsManaged();
367 private static native boolean nativeIsRemoteSuggestionsServiceManagedByCusto dian(); 367 private static native boolean nativeAreRemoteSuggestionsManagedByCustodian() ;
368 private static native void nativeSetContentSuggestionsNotificationsEnabled(b oolean enabled); 368 private static native void nativeSetContentSuggestionsNotificationsEnabled(b oolean enabled);
369 private static native boolean nativeAreContentSuggestionsNotificationsEnable d(); 369 private static native boolean nativeAreContentSuggestionsNotificationsEnable d();
370 private native int[] nativeGetCategories(long nativeNTPSnippetsBridge); 370 private native int[] nativeGetCategories(long nativeNTPSnippetsBridge);
371 private native int nativeGetCategoryStatus(long nativeNTPSnippetsBridge, int category); 371 private native int nativeGetCategoryStatus(long nativeNTPSnippetsBridge, int category);
372 private native SuggestionsCategoryInfo nativeGetCategoryInfo( 372 private native SuggestionsCategoryInfo nativeGetCategoryInfo(
373 long nativeNTPSnippetsBridge, int category); 373 long nativeNTPSnippetsBridge, int category);
374 private native List<SnippetArticle> nativeGetSuggestionsForCategory( 374 private native List<SnippetArticle> nativeGetSuggestionsForCategory(
375 long nativeNTPSnippetsBridge, int category); 375 long nativeNTPSnippetsBridge, int category);
376 private native void nativeFetchSuggestionImage(long nativeNTPSnippetsBridge, int category, 376 private native void nativeFetchSuggestionImage(long nativeNTPSnippetsBridge, int category,
377 String idWithinCategory, Callback<Bitmap> callback); 377 String idWithinCategory, Callback<Bitmap> callback);
(...skipping 19 matching lines...) Expand all
397 float score); 397 float score);
398 private native void nativeOnMoreButtonShown( 398 private native void nativeOnMoreButtonShown(
399 long nativeNTPSnippetsBridge, int category, int position); 399 long nativeNTPSnippetsBridge, int category, int position);
400 private native void nativeOnMoreButtonClicked( 400 private native void nativeOnMoreButtonClicked(
401 long nativeNTPSnippetsBridge, int category, int position); 401 long nativeNTPSnippetsBridge, int category, int position);
402 private native void nativeOnActivityWarmResumed(long nativeNTPSnippetsBridge ); 402 private native void nativeOnActivityWarmResumed(long nativeNTPSnippetsBridge );
403 private native void nativeOnColdStart(long nativeNTPSnippetsBridge); 403 private native void nativeOnColdStart(long nativeNTPSnippetsBridge);
404 private static native void nativeOnSuggestionTargetVisited(int category, lon g visitTimeMs); 404 private static native void nativeOnSuggestionTargetVisited(int category, lon g visitTimeMs);
405 private static native void nativeOnNTPInitialized(long nativeNTPSnippetsBrid ge); 405 private static native void nativeOnNTPInitialized(long nativeNTPSnippetsBrid ge);
406 } 406 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698