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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java

Issue 2245013003: Remove "list item" from Android NTP class names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: x Created 4 years, 4 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/cards/ActionListItem.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java
deleted file mode 100644
index b4b254e100380d4dbf6904cd5abd1e3733fe83a6..0000000000000000000000000000000000000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2016 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 org.chromium.chrome.browser.ntp.cards;
-
-import android.view.View;
-
-import org.chromium.base.Log;
-import org.chromium.chrome.R;
-import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
-import org.chromium.chrome.browser.ntp.UiConfig;
-import org.chromium.chrome.browser.ntp.snippets.KnownCategories;
-
-/**
- * Item that allows the user to perform an action on the NTP.
- */
-class ActionListItem implements NewTabPageListItem {
- private static final String TAG = "NtpCards";
-
- private final int mCategory;
-
- public ActionListItem(int category) {
- mCategory = category;
- }
-
- @Override
- public int getType() {
- return NewTabPageListItem.VIEW_TYPE_ACTION;
- }
-
- public static class ViewHolder extends CardViewHolder {
- private ActionListItem mActionListItem;
-
- public ViewHolder(NewTabPageRecyclerView recyclerView, final NewTabPageManager manager,
- UiConfig uiConfig) {
- super(R.layout.new_tab_page_action_card, recyclerView, uiConfig);
- itemView.findViewById(R.id.action_button)
- .setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- int category = mActionListItem.mCategory;
- if (category == KnownCategories.BOOKMARKS) {
- manager.navigateToBookmarks();
- } else if (category == KnownCategories.DOWNLOADS) {
- manager.navigateToDownloadManager();
- } else {
- // TODO(pke): This should redirect to the C++ backend. Once it does,
- // change the condition in the SuggestionsSection constructor.
- Log.wtf(TAG,
- "More action called on a dynamically added section: %d",
- category);
- }
- }
- });
- }
-
- @Override
- public void onBindViewHolder(NewTabPageListItem item) {
- super.onBindViewHolder(item);
- mActionListItem = (ActionListItem) item;
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698