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

Side by Side Diff: chrome/browser/ui/android/infobars/infobar_android.cc

Issue 2815653003: IPH - connect data saver previews (Closed)
Patch Set: Addressed 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/android/infobars/infobar_android.h" 5 #include "chrome/browser/ui/android/infobars/infobar_android.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 jobject InfoBarAndroid::GetJavaInfoBar() { 50 jobject InfoBarAndroid::GetJavaInfoBar() {
51 return java_info_bar_.obj(); 51 return java_info_bar_.obj();
52 } 52 }
53 53
54 bool InfoBarAndroid::HasSetJavaInfoBar() const { 54 bool InfoBarAndroid::HasSetJavaInfoBar() const {
55 return !java_info_bar_.is_null(); 55 return !java_info_bar_.is_null();
56 } 56 }
57 57
58 int InfoBarAndroid::GetInfoBarIdentifier(JNIEnv* env,
59 const JavaParamRef<jobject>& obj) {
60 return delegate()->GetIdentifier();
61 }
62
58 void InfoBarAndroid::OnButtonClicked(JNIEnv* env, 63 void InfoBarAndroid::OnButtonClicked(JNIEnv* env,
59 const JavaParamRef<jobject>& obj, 64 const JavaParamRef<jobject>& obj,
60 jint action) { 65 jint action) {
61 ProcessButton(action); 66 ProcessButton(action);
62 } 67 }
63 68
64 void InfoBarAndroid::OnCloseButtonClicked(JNIEnv* env, 69 void InfoBarAndroid::OnCloseButtonClicked(JNIEnv* env,
65 const JavaParamRef<jobject>& obj) { 70 const JavaParamRef<jobject>& obj) {
66 if (!owner()) 71 if (!owner())
67 return; // We're closing; don't call anything, it might access the owner. 72 return; // We're closing; don't call anything, it might access the owner.
(...skipping 11 matching lines...) Expand all
79 int InfoBarAndroid::GetEnumeratedIconId() { 84 int InfoBarAndroid::GetEnumeratedIconId() {
80 return ResourceMapper::MapFromChromiumId(delegate()->GetIconId()); 85 return ResourceMapper::MapFromChromiumId(delegate()->GetIconId());
81 } 86 }
82 87
83 88
84 // Native JNI methods --------------------------------------------------------- 89 // Native JNI methods ---------------------------------------------------------
85 90
86 bool RegisterNativeInfoBar(JNIEnv* env) { 91 bool RegisterNativeInfoBar(JNIEnv* env) {
87 return RegisterNativesImpl(env); 92 return RegisterNativesImpl(env);
88 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698