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

Unified Diff: chrome/browser/previews/previews_infobar_delegate.cc

Issue 2860083003: Add timestamp support to the Previews infobar (Closed)
Patch Set: ryansturm comments 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
Index: chrome/browser/previews/previews_infobar_delegate.cc
diff --git a/chrome/browser/previews/previews_infobar_delegate.cc b/chrome/browser/previews/previews_infobar_delegate.cc
index f37679a55693404c4be770b863392d30c37d2faa..0f947b36cb08d26a35b3d46a683117a1ca19a7d5 100644
--- a/chrome/browser/previews/previews_infobar_delegate.cc
+++ b/chrome/browser/previews/previews_infobar_delegate.cc
@@ -19,6 +19,10 @@
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/ui/android/infobars/previews_infobar.h"
+#endif
+
namespace {
// Key of the UMA Previews.InfoBarAction.LoFi histogram.
@@ -56,6 +60,10 @@ PreviewsInfoBarDelegate::~PreviewsInfoBarDelegate() {
RecordPreviewsInfoBarAction(infobar_type_, infobar_dismissed_action_);
}
+PreviewsInfoBarDelegate* PreviewsInfoBarDelegate::AsPreviewsInfoBarDelegate() {
+ return this;
+}
+
// static
void PreviewsInfoBarDelegate::Create(
content::WebContents* web_contents,
@@ -74,11 +82,20 @@ void PreviewsInfoBarDelegate::Create(
if (infobar_tab_helper->displayed_preview_infobar())
return;
+#if defined(OS_ANDROID)
+ infobars::InfoBar* infobar =
+ infobar_service->AddInfoBar(PreviewsInfoBar::CreateInfoBar(
+ infobar_service,
+ std::unique_ptr<PreviewsInfoBarDelegate>(new PreviewsInfoBarDelegate(
Peter Kasting 2017/05/08 23:33:35 Nit: Since PreviewsInfoBarDelegate is a ConfirmInf
megjablon 2017/05/09 00:14:30 Done.
+ web_contents, infobar_type, is_data_saver_user,
+ on_dismiss_callback))));
+#else
infobars::InfoBar* infobar =
infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
std::unique_ptr<ConfirmInfoBarDelegate>(new PreviewsInfoBarDelegate(
web_contents, infobar_type, is_data_saver_user,
on_dismiss_callback))));
+#endif
if (infobar && (infobar_type == LITE_PAGE || infobar_type == LOFI)) {
auto* data_reduction_proxy_settings =
@@ -179,3 +196,7 @@ bool PreviewsInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
return true;
}
+
+base::string16 PreviewsInfoBarDelegate::GetTimestampText() const {
+ return base::string16();
+}

Powered by Google App Engine
This is Rietveld 408576698