Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..39c8afe43f0cf01eb3f36d376b5a705615e9fea0 |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java |
| @@ -0,0 +1,36 @@ |
| +// 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.LayoutInflater; |
| +import android.view.View; |
| + |
| +import org.chromium.chrome.browser.ntp.NewTabPageView; |
| + |
| +/** |
| + * Item that allows the user to perform an action on the NTP. |
| + */ |
| +class ActionListItem implements NewTabPageListItem { |
| + @Override |
| + public int getType() { |
| + return NewTabPageListItem.VIEW_TYPE_ACTION; |
| + } |
| + |
| + public static class ViewHolder extends NewTabPageViewHolder { |
| + public ViewHolder(final NewTabPageRecyclerView recyclerView, |
| + final NewTabPageView.NewTabPageManager manager) { |
| + super(LayoutInflater.from(recyclerView.getContext()) |
| + .inflate(org.chromium.chrome.R.layout.new_tab_page_action_card, |
| + recyclerView, false)); |
| + itemView.setOnClickListener(new View.OnClickListener() { |
| + @Override |
| + public void onClick(View v) { |
| + // TODO(dgn): Implement other behaviours. |
| + manager.navigateToBookmarks(); |
|
Bernhard Bauer
2016/08/09 09:02:06
Ideally, I would like to trigger this from the Sug
dgn
2016/08/09 13:00:42
Yes, I'm leaving that up to another CL, when we ha
|
| + } |
| + }); |
| + } |
| + } |
| +} |