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

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

Issue 2792583002: 📱 Simplify naming of generated java enums IntDefs (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
index d1ef227950a2a598f09cb4512a56f7cbc3e02b42..d9bbd3885ac0e43b7565329fe599c9b44ba59992 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
@@ -11,10 +11,8 @@
import org.chromium.chrome.browser.ntp.NewTabPageUma;
import org.chromium.chrome.browser.ntp.cards.ActionItem;
import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo;
-import org.chromium.chrome.browser.ntp.snippets.CategoryStatus.CategoryStatusEnum;
-import org.chromium.chrome.browser.ntp.snippets.ContentSuggestionsCardLayout.ContentSuggestionsCardLayoutEnum;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.suggestions.ContentSuggestionsAdditionalAction.ContentSuggestionsAdditionalActionEnum;
+import org.chromium.chrome.browser.suggestions.ContentSuggestionsAdditionalAction;
import org.chromium.chrome.browser.suggestions.DestructionObserver;
import org.chromium.chrome.browser.suggestions.SuggestionsMetricsReporter;
import org.chromium.chrome.browser.suggestions.SuggestionsRanker;
@@ -33,13 +31,13 @@
private SuggestionsSource.Observer mObserver;
private SuggestionsRanker mSuggestionsRanker;
- public static boolean isCategoryStatusAvailable(@CategoryStatusEnum int status) {
+ public static boolean isCategoryStatusAvailable(@CategoryStatus int status) {
// Note: This code is duplicated in content_suggestions_category_status.cc.
return status == CategoryStatus.AVAILABLE_LOADING || status == CategoryStatus.AVAILABLE;
}
/** Returns whether the category is considered "enabled", and can show content suggestions. */
- public static boolean isCategoryEnabled(@CategoryStatusEnum int status) {
+ public static boolean isCategoryEnabled(@CategoryStatus int status) {
switch (status) {
case CategoryStatus.INITIALIZING:
case CategoryStatus.AVAILABLE:
@@ -49,7 +47,7 @@ public static boolean isCategoryEnabled(@CategoryStatusEnum int status) {
return false;
}
- public static boolean isCategoryLoading(@CategoryStatusEnum int status) {
+ public static boolean isCategoryLoading(@CategoryStatus int status) {
return status == CategoryStatus.AVAILABLE_LOADING || status == CategoryStatus.INITIALIZING;
}
@@ -124,7 +122,7 @@ public void fetchRemoteSuggestions() {
}
@Override
- @CategoryStatusEnum
+ @CategoryStatus
public int getCategoryStatus(int category) {
assert mNativeSnippetsBridge != 0;
return nativeGetCategoryStatus(mNativeSnippetsBridge, category);
@@ -323,8 +321,8 @@ private static void setRecentTabDataForSuggestion(
@CalledByNative
private static SuggestionsCategoryInfo createSuggestionsCategoryInfo(int category, String title,
- @ContentSuggestionsCardLayoutEnum int cardLayout,
- @ContentSuggestionsAdditionalActionEnum int additionalAction, boolean showIfEmpty,
+ @ContentSuggestionsCardLayout int cardLayout,
+ @ContentSuggestionsAdditionalAction int additionalAction, boolean showIfEmpty,
String noSuggestionsMessage) {
return new SuggestionsCategoryInfo(
category, title, cardLayout, additionalAction, showIfEmpty, noSuggestionsMessage);
@@ -341,8 +339,7 @@ private void onMoreSuggestions(@CategoryInt int category, List<SnippetArticle> s
}
@CalledByNative
- private void onCategoryStatusChanged(
- @CategoryInt int category, @CategoryStatusEnum int newStatus) {
+ private void onCategoryStatusChanged(@CategoryInt int category, @CategoryStatus int newStatus) {
if (mObserver != null) mObserver.onCategoryStatusChanged(category, newStatus);
}

Powered by Google App Engine
This is Rietveld 408576698