| OLD | NEW | 
|   1 // Copyright 2014 The Chromium Authors. All rights reserved. |   1 // Copyright 2014 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/generated_password_saved_infobar.h" |   5 #include "chrome/browser/ui/android/infobars/generated_password_saved_infobar.h" | 
|   6  |   6  | 
|   7 #include "base/android/jni_android.h" |   7 #include "base/android/jni_android.h" | 
|   8 #include "base/android/jni_string.h" |   8 #include "base/android/jni_string.h" | 
|   9 #include "chrome/browser/infobars/infobar_service.h" |   9 #include "chrome/browser/infobars/infobar_service.h" | 
|  10 #include "content/public/browser/web_contents.h" |  10 #include "content/public/browser/web_contents.h" | 
| (...skipping 24 matching lines...) Expand all  Loading... | 
|  35   return Java_GeneratedPasswordSavedInfoBarDelegate_show( |  35   return Java_GeneratedPasswordSavedInfoBarDelegate_show( | 
|  36       env, GetEnumeratedIconId(), |  36       env, GetEnumeratedIconId(), | 
|  37       base::android::ConvertUTF16ToJavaString( |  37       base::android::ConvertUTF16ToJavaString( | 
|  38           env, infobar_delegate->message_text()).obj(), |  38           env, infobar_delegate->message_text()).obj(), | 
|  39       infobar_delegate->inline_link_range().start(), |  39       infobar_delegate->inline_link_range().start(), | 
|  40       infobar_delegate->inline_link_range().end(), |  40       infobar_delegate->inline_link_range().end(), | 
|  41       base::android::ConvertUTF16ToJavaString( |  41       base::android::ConvertUTF16ToJavaString( | 
|  42           env, infobar_delegate->button_label()).obj()); |  42           env, infobar_delegate->button_label()).obj()); | 
|  43 } |  43 } | 
|  44  |  44  | 
|  45 void GeneratedPasswordSavedInfoBar::OnLinkClicked(JNIEnv* env, jobject obj) { |  45 void GeneratedPasswordSavedInfoBar::OnLinkClicked( | 
 |  46     JNIEnv* env, | 
 |  47     const JavaParamRef<jobject>& obj) { | 
|  46   if (!owner()) |  48   if (!owner()) | 
|  47     return; |  49     return; | 
|  48  |  50  | 
|  49   static_cast<GeneratedPasswordSavedInfoBarDelegateAndroid*>(delegate()) |  51   static_cast<GeneratedPasswordSavedInfoBarDelegateAndroid*>(delegate()) | 
|  50       ->OnInlineLinkClicked(); |  52       ->OnInlineLinkClicked(); | 
|  51   RemoveSelf(); |  53   RemoveSelf(); | 
|  52 } |  54 } | 
|  53  |  55  | 
|  54 void GeneratedPasswordSavedInfoBar::ProcessButton(int action) { |  56 void GeneratedPasswordSavedInfoBar::ProcessButton(int action) { | 
|  55   if (!owner()) |  57   if (!owner()) | 
|  56     return; |  58     return; | 
|  57  |  59  | 
|  58   RemoveSelf(); |  60   RemoveSelf(); | 
|  59 } |  61 } | 
|  60  |  62  | 
|  61 bool RegisterGeneratedPasswordSavedInfoBarDelegate(JNIEnv* env) { |  63 bool RegisterGeneratedPasswordSavedInfoBarDelegate(JNIEnv* env) { | 
|  62   return RegisterNativesImpl(env); |  64   return RegisterNativesImpl(env); | 
|  63 } |  65 } | 
| OLD | NEW |