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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsInfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsInfoBar.java
new file mode 100644
index 0000000000000000000000000000000000000000..4c07d2aa0f92cfae45bcf8a26ba0d5d7bbae5aeb
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsInfoBar.java
@@ -0,0 +1,36 @@
+// Copyright 2017 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.infobar;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.chrome.browser.ResourceId;
+
+/**
+ * An InfoBar that lets the user know that a Preview page has been loaded, and gives the user
+ * a link to reload the original page. This InfoBar will only be shown once per page load.
+ */
+public class PreviewsInfoBar extends ConfirmInfoBar {
+ private final String mTimestampText;
+
+ @CalledByNative
+ private static InfoBar show(
+ int enumeratedIconId, String message, String linkText, String timestampText) {
+ return new PreviewsInfoBar(
+ ResourceId.mapToDrawableId(enumeratedIconId), message, linkText, timestampText);
+ }
+
+ private PreviewsInfoBar(
+ int iconDrawbleId, String message, String linkText, String timestampText) {
+ super(iconDrawbleId, null, message, linkText, null, null);
+ mTimestampText = timestampText;
+ }
+
+ @Override
+ public void createContent(InfoBarLayout layout) {
+ super.createContent(layout);
+ if (mTimestampText.isEmpty()) return;
+ layout.getMessageLayout().addDescription(mTimestampText);
+ }
+}
« 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