OLD | NEW |
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/android/password_ui_view_android.h" | 5 #include "chrome/browser/android/password_ui_view_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/android/jni_weak_ref.h" | 8 #include "base/android/jni_weak_ref.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void PasswordUIViewAndroid::HandleRemoveSavedPasswordEntry( | 103 void PasswordUIViewAndroid::HandleRemoveSavedPasswordEntry( |
104 JNIEnv* env, jobject, int index) { | 104 JNIEnv* env, jobject, int index) { |
105 password_manager_presenter_.RemoveSavedPassword(index); | 105 password_manager_presenter_.RemoveSavedPassword(index); |
106 } | 106 } |
107 | 107 |
108 void PasswordUIViewAndroid::HandleRemoveSavedPasswordException( | 108 void PasswordUIViewAndroid::HandleRemoveSavedPasswordException( |
109 JNIEnv* env, jobject, int index) { | 109 JNIEnv* env, jobject, int index) { |
110 password_manager_presenter_.RemovePasswordException(index); | 110 password_manager_presenter_.RemovePasswordException(index); |
111 } | 111 } |
112 | 112 |
113 ScopedJavaLocalRef<jstring> GetAccountDashboardURL(JNIEnv* env, jclass) { | 113 ScopedJavaLocalRef<jstring> GetAccountDashboardURL( |
| 114 JNIEnv* env, |
| 115 const JavaParamRef<jclass>&) { |
114 return ConvertUTF8ToJavaString(env, | 116 return ConvertUTF8ToJavaString(env, |
115 chrome::kPasswordManagerAccountDashboardURL); | 117 chrome::kPasswordManagerAccountDashboardURL); |
116 } | 118 } |
117 | 119 |
118 static jboolean ShouldDisplayManageAccountLink( | 120 static jboolean ShouldDisplayManageAccountLink(JNIEnv* env, |
119 JNIEnv* env, jclass) { | 121 const JavaParamRef<jclass>&) { |
120 return password_manager::ManageAccountLinkExperimentEnabled(); | 122 return password_manager::ManageAccountLinkExperimentEnabled(); |
121 } | 123 } |
122 | 124 |
123 static jboolean ShouldUseSmartLockBranding( | 125 static jboolean ShouldUseSmartLockBranding(JNIEnv* env, |
124 JNIEnv* env, jclass) { | 126 const JavaParamRef<jclass>&) { |
125 const ProfileSyncService* sync_service = | 127 const ProfileSyncService* sync_service = |
126 ProfileSyncServiceFactory::GetForProfile( | 128 ProfileSyncServiceFactory::GetForProfile( |
127 ProfileManager::GetLastUsedProfile()); | 129 ProfileManager::GetLastUsedProfile()); |
128 return password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service); | 130 return password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service); |
129 } | 131 } |
130 | 132 |
131 // static | 133 // static |
132 static jlong Init(JNIEnv* env, jobject obj) { | 134 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
133 PasswordUIViewAndroid* controller = new PasswordUIViewAndroid(env, obj); | 135 PasswordUIViewAndroid* controller = new PasswordUIViewAndroid(env, obj); |
134 return reinterpret_cast<intptr_t>(controller); | 136 return reinterpret_cast<intptr_t>(controller); |
135 } | 137 } |
136 | 138 |
137 bool PasswordUIViewAndroid::RegisterPasswordUIViewAndroid(JNIEnv* env) { | 139 bool PasswordUIViewAndroid::RegisterPasswordUIViewAndroid(JNIEnv* env) { |
138 return RegisterNativesImpl(env); | 140 return RegisterNativesImpl(env); |
139 } | 141 } |
OLD | NEW |