| 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" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" | 13 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
| 14 #include "chrome/browser/ui/passwords/password_bubble_experiment.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 16 #include "components/autofill/core/common/password_form.h" | 17 #include "components/autofill/core/common/password_form.h" |
| 17 #include "components/password_manager/core/common/experiments.h" | 18 #include "components/password_manager/core/common/experiments.h" |
| 18 #include "components/password_manager/core/common/password_manager_switches.h" | 19 #include "components/password_manager/core/common/password_manager_switches.h" |
| 19 #include "jni/PasswordUIView_jni.h" | 20 #include "jni/PasswordUIView_jni.h" |
| 20 | 21 |
| 21 using base::android::ConvertUTF16ToJavaString; | 22 using base::android::ConvertUTF16ToJavaString; |
| 22 using base::android::ConvertUTF8ToJavaString; | 23 using base::android::ConvertUTF8ToJavaString; |
| 23 using base::android::ScopedJavaLocalRef; | 24 using base::android::ScopedJavaLocalRef; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 jstring GetAccountDashboardURL(JNIEnv* env, jclass) { | 108 jstring GetAccountDashboardURL(JNIEnv* env, jclass) { |
| 108 return ConvertUTF8ToJavaString( | 109 return ConvertUTF8ToJavaString( |
| 109 env, chrome::kPasswordManagerAccountDashboardURL).Release(); | 110 env, chrome::kPasswordManagerAccountDashboardURL).Release(); |
| 110 } | 111 } |
| 111 | 112 |
| 112 static jboolean ShouldDisplayManageAccountLink( | 113 static jboolean ShouldDisplayManageAccountLink( |
| 113 JNIEnv* env, jclass) { | 114 JNIEnv* env, jclass) { |
| 114 return password_manager::ManageAccountLinkExperimentEnabled(); | 115 return password_manager::ManageAccountLinkExperimentEnabled(); |
| 115 } | 116 } |
| 116 | 117 |
| 118 static jboolean ShouldUseSmartLockBranding( |
| 119 JNIEnv* env, jclass) { |
| 120 return password_bubble_experiment::IsSmartLockBrandingEnabled( |
| 121 ProfileManager::GetLastUsedProfile()); |
| 122 } |
| 123 |
| 117 // static | 124 // static |
| 118 static jlong Init(JNIEnv* env, jobject obj) { | 125 static jlong Init(JNIEnv* env, jobject obj) { |
| 119 PasswordUIViewAndroid* controller = new PasswordUIViewAndroid(env, obj); | 126 PasswordUIViewAndroid* controller = new PasswordUIViewAndroid(env, obj); |
| 120 return reinterpret_cast<intptr_t>(controller); | 127 return reinterpret_cast<intptr_t>(controller); |
| 121 } | 128 } |
| 122 | 129 |
| 123 bool PasswordUIViewAndroid::RegisterPasswordUIViewAndroid(JNIEnv* env) { | 130 bool PasswordUIViewAndroid::RegisterPasswordUIViewAndroid(JNIEnv* env) { |
| 124 return RegisterNativesImpl(env); | 131 return RegisterNativesImpl(env); |
| 125 } | 132 } |
| OLD | NEW |