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

Unified Diff: chrome/browser/ui/android/infobars/previews_infobar.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/ui/android/infobars/previews_infobar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/previews_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/previews_infobar.cc b/chrome/browser/ui/android/infobars/previews_infobar.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1cc10075bdecd687ef9441953cd0d8e77561e693
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/previews_infobar.cc
@@ -0,0 +1,40 @@
+// 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.
+
+#include "chrome/browser/ui/android/infobars/previews_infobar.h"
+
+#include <utility>
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+#include "base/memory/ptr_util.h"
+#include "jni/PreviewsInfoBar_jni.h"
+
+PreviewsInfoBar::PreviewsInfoBar(
+ std::unique_ptr<PreviewsInfoBarDelegate> delegate)
+ : ConfirmInfoBar(std::move(delegate)) {}
+
+PreviewsInfoBar::~PreviewsInfoBar() {}
+
+base::android::ScopedJavaLocalRef<jobject> PreviewsInfoBar::CreateRenderInfoBar(
+ JNIEnv* env) {
+ PreviewsInfoBarDelegate* delegate =
+ static_cast<PreviewsInfoBarDelegate*>(GetDelegate());
+ base::android::ScopedJavaLocalRef<jstring> message_text =
+ base::android::ConvertUTF16ToJavaString(env, delegate->GetMessageText());
+ base::android::ScopedJavaLocalRef<jstring> link_text =
+ base::android::ConvertUTF16ToJavaString(env, delegate->GetLinkText());
+ base::android::ScopedJavaLocalRef<jstring> timestamp_text =
+ base::android::ConvertUTF16ToJavaString(env,
+ delegate->GetTimestampText());
+ return Java_PreviewsInfoBar_show(env, GetEnumeratedIconId(), message_text,
+ link_text, timestamp_text);
+}
+
+// static
+std::unique_ptr<infobars::InfoBar> PreviewsInfoBar::CreateInfoBar(
+ infobars::InfoBarManager* infobar_manager,
+ std::unique_ptr<PreviewsInfoBarDelegate> delegate) {
+ return base::MakeUnique<PreviewsInfoBar>(std::move(delegate));
+}
« no previous file with comments | « chrome/browser/ui/android/infobars/previews_infobar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698