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

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

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 | « chrome/browser/previews/previews_infobar_delegate.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e94f414993d5ec9a2387d1f0a603c8d6711c667d 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.
@@ -74,11 +78,19 @@ void PreviewsInfoBarDelegate::Create(
if (infobar_tab_helper->displayed_preview_infobar())
return;
+ std::unique_ptr<PreviewsInfoBarDelegate> delegate(new PreviewsInfoBarDelegate(
+ web_contents, infobar_type, is_data_saver_user, on_dismiss_callback));
+
+#if defined(OS_ANDROID)
+ std::unique_ptr<infobars::InfoBar> infobar_ptr(
+ PreviewsInfoBar::CreateInfoBar(infobar_service, std::move(delegate)));
+#else
+ std::unique_ptr<infobars::InfoBar> infobar_ptr(
+ infobar_service->CreateConfirmInfoBar(std::move(delegate)));
+#endif
+
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))));
+ infobar_service->AddInfoBar(std::move(infobar_ptr));
if (infobar && (infobar_type == LITE_PAGE || infobar_type == LOFI)) {
auto* data_reduction_proxy_settings =
@@ -179,3 +191,7 @@ bool PreviewsInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
return true;
}
+
+base::string16 PreviewsInfoBarDelegate::GetTimestampText() const {
+ return base::string16();
+}
« no previous file with comments | « chrome/browser/previews/previews_infobar_delegate.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698