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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsInfoBar.java

Issue 2860083003: Add timestamp support to the Previews infobar (Closed)
Patch Set: sync and rebase Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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.chrome.browser.infobar;
6
7 import org.chromium.base.annotations.CalledByNative;
8 import org.chromium.chrome.browser.ResourceId;
9
10 /**
11 * An InfoBar that lets the user know that a Preview page has been loaded, and g ives the user
12 * a link to reload the original page. This InfoBar will only be shown once per page load.
13 */
14 public class PreviewsInfoBar extends ConfirmInfoBar {
15 private final String mTimestampText;
16
17 @CalledByNative
18 private static InfoBar show(
19 int enumeratedIconId, String message, String linkText, String timest ampText) {
20 return new PreviewsInfoBar(
21 ResourceId.mapToDrawableId(enumeratedIconId), message, linkText, timestampText);
22 }
23
24 private PreviewsInfoBar(
25 int iconDrawbleId, String message, String linkText, String timestamp Text) {
26 super(iconDrawbleId, null, message, linkText, null, null);
27 mTimestampText = timestampText;
28 }
29
30 @Override
31 public void createContent(InfoBarLayout layout) {
32 super.createContent(layout);
33 if (mTimestampText.isEmpty()) return;
34 layout.getMessageLayout().addDescription(mTimestampText);
35 }
36 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698