| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_DIALOG_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_DIALOG_ANDROID_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_DIALOG_ANDROID_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_DIALOG_ANDROID_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class AccountChooserDialogAndroid { | 24 class AccountChooserDialogAndroid { |
| 25 public: | 25 public: |
| 26 AccountChooserDialogAndroid( | 26 AccountChooserDialogAndroid( |
| 27 content::WebContents* web_contents, | 27 content::WebContents* web_contents, |
| 28 ScopedVector<autofill::PasswordForm> local_credentials, | 28 ScopedVector<autofill::PasswordForm> local_credentials, |
| 29 ScopedVector<autofill::PasswordForm> federated_credentials, | 29 ScopedVector<autofill::PasswordForm> federated_credentials, |
| 30 const GURL& origin, | 30 const GURL& origin, |
| 31 const ManagePasswordsState::CredentialsCallback& callback); | 31 const ManagePasswordsState::CredentialsCallback& callback); |
| 32 | 32 |
| 33 ~AccountChooserDialogAndroid(); | 33 ~AccountChooserDialogAndroid(); |
| 34 void Destroy(JNIEnv* env, jobject obj); | 34 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 35 | 35 |
| 36 void ShowDialog(); | 36 void ShowDialog(); |
| 37 | 37 |
| 38 // Closes the dialog and propagates that no credentials was chosen. | 38 // Closes the dialog and propagates that no credentials was chosen. |
| 39 void CancelDialog(JNIEnv* env, jobject obj); | 39 void CancelDialog(JNIEnv* env, |
| 40 const base::android::JavaParamRef<jobject>& obj); |
| 40 | 41 |
| 41 // Propagates the credentials chosen by the user. | 42 // Propagates the credentials chosen by the user. |
| 42 void OnCredentialClicked(JNIEnv* env, | 43 void OnCredentialClicked(JNIEnv* env, |
| 43 jobject obj, | 44 const base::android::JavaParamRef<jobject>& obj, |
| 44 jint credential_item, | 45 jint credential_item, |
| 45 jint credential_type); | 46 jint credential_type); |
| 46 | 47 |
| 47 // Opens new tab with page which explains the Smart Lock branding. | 48 // Opens new tab with page which explains the Smart Lock branding. |
| 48 void OnLinkClicked(JNIEnv* env, jobject obj); | 49 void OnLinkClicked(JNIEnv* env, |
| 50 const base::android::JavaParamRef<jobject>& obj); |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 const std::vector<const autofill::PasswordForm*>& local_credentials_forms() | 53 const std::vector<const autofill::PasswordForm*>& local_credentials_forms() |
| 52 const; | 54 const; |
| 53 | 55 |
| 54 const std::vector<const autofill::PasswordForm*>& | 56 const std::vector<const autofill::PasswordForm*>& |
| 55 federated_credentials_forms() const; | 57 federated_credentials_forms() const; |
| 56 | 58 |
| 57 void ChooseCredential(size_t index, password_manager::CredentialType type); | 59 void ChooseCredential(size_t index, password_manager::CredentialType type); |
| 58 | 60 |
| 59 content::WebContents* web_contents_; | 61 content::WebContents* web_contents_; |
| 60 ManagePasswordsState passwords_data_; | 62 ManagePasswordsState passwords_data_; |
| 61 | 63 |
| 62 DISALLOW_COPY_AND_ASSIGN(AccountChooserDialogAndroid); | 64 DISALLOW_COPY_AND_ASSIGN(AccountChooserDialogAndroid); |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 // Native JNI methods | 67 // Native JNI methods |
| 66 bool RegisterAccountChooserDialogAndroid(JNIEnv* env); | 68 bool RegisterAccountChooserDialogAndroid(JNIEnv* env); |
| 67 | 69 |
| 68 #endif // CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_DIALOG_ANDROID_H_ | 70 #endif // CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_DIALOG_ANDROID_H_ |
| OLD | NEW |