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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/android/infobars/previews_infobar.h ('k') | no next file » | 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 #include "chrome/browser/ui/android/infobars/previews_infobar.h"
6
7 #include <utility>
8
9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h"
11 #include "base/memory/ptr_util.h"
12 #include "jni/PreviewsInfoBar_jni.h"
13
14 PreviewsInfoBar::PreviewsInfoBar(
15 std::unique_ptr<PreviewsInfoBarDelegate> delegate)
16 : ConfirmInfoBar(std::move(delegate)) {}
17
18 PreviewsInfoBar::~PreviewsInfoBar() {}
19
20 base::android::ScopedJavaLocalRef<jobject> PreviewsInfoBar::CreateRenderInfoBar(
21 JNIEnv* env) {
22 PreviewsInfoBarDelegate* delegate =
23 static_cast<PreviewsInfoBarDelegate*>(GetDelegate());
24 base::android::ScopedJavaLocalRef<jstring> message_text =
25 base::android::ConvertUTF16ToJavaString(env, delegate->GetMessageText());
26 base::android::ScopedJavaLocalRef<jstring> link_text =
27 base::android::ConvertUTF16ToJavaString(env, delegate->GetLinkText());
28 base::android::ScopedJavaLocalRef<jstring> timestamp_text =
29 base::android::ConvertUTF16ToJavaString(env,
30 delegate->GetTimestampText());
31 return Java_PreviewsInfoBar_show(env, GetEnumeratedIconId(), message_text,
32 link_text, timestamp_text);
33 }
34
35 // static
36 std::unique_ptr<infobars::InfoBar> PreviewsInfoBar::CreateInfoBar(
37 infobars::InfoBarManager* infobar_manager,
38 std::unique_ptr<PreviewsInfoBarDelegate> delegate) {
39 return base::MakeUnique<PreviewsInfoBar>(std::move(delegate));
40 }
OLDNEW
« 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