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

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

Issue 1481553002: jni: Pass method parameters as JavaParamRef in chrome/browser/ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/confirm_infobar.h" 5 #include "chrome/browser/ui/android/infobars/confirm_infobar.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 cvc->GetWindowAndroid()->GetJavaObject(); 95 cvc->GetWindowAndroid()->GetJavaObject();
96 96
97 return Java_ConfirmInfoBarDelegate_showConfirmInfoBar( 97 return Java_ConfirmInfoBarDelegate_showConfirmInfoBar(
98 env, java_confirm_delegate_.obj(), 98 env, java_confirm_delegate_.obj(),
99 jwindow_android.obj(), GetEnumeratedIconId(), java_bitmap.obj(), 99 jwindow_android.obj(), GetEnumeratedIconId(), java_bitmap.obj(),
100 message_text.obj(), link_text.obj(), ok_button_text.obj(), 100 message_text.obj(), link_text.obj(), ok_button_text.obj(),
101 cancel_button_text.obj(), 101 cancel_button_text.obj(),
102 base::android::ToJavaIntArray(env, content_settings).obj()); 102 base::android::ToJavaIntArray(env, content_settings).obj());
103 } 103 }
104 104
105 void ConfirmInfoBar::OnLinkClicked(JNIEnv* env, jobject obj) { 105 void ConfirmInfoBar::OnLinkClicked(JNIEnv* env,
106 const JavaParamRef<jobject>& obj) {
106 if (!owner()) 107 if (!owner())
107 return; // We're closing; don't call anything, it might access the owner. 108 return; // We're closing; don't call anything, it might access the owner.
108 109
109 if (GetDelegate()->LinkClicked(NEW_FOREGROUND_TAB)) 110 if (GetDelegate()->LinkClicked(NEW_FOREGROUND_TAB))
110 RemoveSelf(); 111 RemoveSelf();
111 } 112 }
112 113
113 void ConfirmInfoBar::ProcessButton(int action) { 114 void ConfirmInfoBar::ProcessButton(int action) {
114 if (!owner()) 115 if (!owner())
115 return; // We're closing; don't call anything, it might access the owner. 116 return; // We're closing; don't call anything, it might access the owner.
(...skipping 16 matching lines...) Expand all
132 return (delegate->GetButtons() & button) ? 133 return (delegate->GetButtons() & button) ?
133 delegate->GetButtonLabel(button) : base::string16(); 134 delegate->GetButtonLabel(button) : base::string16();
134 } 135 }
135 136
136 137
137 // Native JNI methods --------------------------------------------------------- 138 // Native JNI methods ---------------------------------------------------------
138 139
139 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) { 140 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) {
140 return RegisterNativesImpl(env); 141 return RegisterNativesImpl(env);
141 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698