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 jstring GetAccountDashboardURL(JNIEnv* env, jclass) { | 113 ScopedJavaLocalRef<jstring> GetAccountDashboardURL(JNIEnv* env, jclass) { |
114 return ConvertUTF8ToJavaString( | 114 return ConvertUTF8ToJavaString(env, |
115 env, chrome::kPasswordManagerAccountDashboardURL).Release(); | 115 chrome::kPasswordManagerAccountDashboardURL); |
116 } | 116 } |
117 | 117 |
118 static jboolean ShouldDisplayManageAccountLink( | 118 static jboolean ShouldDisplayManageAccountLink( |
119 JNIEnv* env, jclass) { | 119 JNIEnv* env, jclass) { |
120 return password_manager::ManageAccountLinkExperimentEnabled(); | 120 return password_manager::ManageAccountLinkExperimentEnabled(); |
121 } | 121 } |
122 | 122 |
123 static jboolean ShouldUseSmartLockBranding( | 123 static jboolean ShouldUseSmartLockBranding( |
124 JNIEnv* env, jclass) { | 124 JNIEnv* env, jclass) { |
125 const ProfileSyncService* sync_service = | 125 const ProfileSyncService* sync_service = |
126 ProfileSyncServiceFactory::GetForProfile( | 126 ProfileSyncServiceFactory::GetForProfile( |
127 ProfileManager::GetLastUsedProfile()); | 127 ProfileManager::GetLastUsedProfile()); |
128 return password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service); | 128 return password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service); |
129 } | 129 } |
130 | 130 |
131 // static | 131 // static |
132 static jlong Init(JNIEnv* env, jobject obj) { | 132 static jlong Init(JNIEnv* env, jobject obj) { |
133 PasswordUIViewAndroid* controller = new PasswordUIViewAndroid(env, obj); | 133 PasswordUIViewAndroid* controller = new PasswordUIViewAndroid(env, obj); |
134 return reinterpret_cast<intptr_t>(controller); | 134 return reinterpret_cast<intptr_t>(controller); |
135 } | 135 } |
136 | 136 |
137 bool PasswordUIViewAndroid::RegisterPasswordUIViewAndroid(JNIEnv* env) { | 137 bool PasswordUIViewAndroid::RegisterPasswordUIViewAndroid(JNIEnv* env) { |
138 return RegisterNativesImpl(env); | 138 return RegisterNativesImpl(env); |
139 } | 139 } |
OLD | NEW |