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 #ifndef CHROME_BROWSER_ANDROID_PASSWORD_UI_VIEW_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_PASSWORD_UI_VIEW_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_PASSWORD_UI_VIEW_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_PASSWORD_UI_VIEW_ANDROID_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "chrome/browser/password_manager/password_store_factory.h" | 12 #include "chrome/browser/password_manager/password_store_factory.h" |
13 #include "chrome/browser/ui/passwords/password_manager_presenter.h" | 13 #include "chrome/browser/ui/passwords/password_manager_presenter.h" |
14 #include "chrome/browser/ui/passwords/password_ui_view.h" | 14 #include "chrome/browser/ui/passwords/password_ui_view.h" |
15 #include "components/password_manager/core/browser/password_store.h" | 15 #include "components/password_manager/core/browser/password_store.h" |
16 #include "components/password_manager/core/browser/password_store_consumer.h" | 16 #include "components/password_manager/core/browser/password_store_consumer.h" |
17 | 17 |
18 // PasswordUIView for Android, contains jni hooks that allows Android UI to | 18 // PasswordUIView for Android, contains jni hooks that allows Android UI to |
19 // display passwords and route UI commands back to native | 19 // display passwords and route UI commands back to native |
20 // PasswordManagerPresenter. | 20 // PasswordManagerPresenter. |
21 class PasswordUIViewAndroid : public PasswordUIView { | 21 class PasswordUIViewAndroid : public PasswordUIView { |
22 public: | 22 public: |
23 PasswordUIViewAndroid(JNIEnv* env, jobject); | 23 PasswordUIViewAndroid(JNIEnv* env, jobject); |
24 ~PasswordUIViewAndroid() override; | 24 ~PasswordUIViewAndroid() override; |
25 | 25 |
26 // PasswordUIView implementation. | 26 // PasswordUIView implementation. |
27 Profile* GetProfile() override; | 27 Profile* GetProfile() override; |
28 void ShowPassword(size_t index, | 28 void ShowPassword( |
29 const base::string16& password_value) override; | 29 size_t index, |
| 30 const std::string& origin_url, |
| 31 const std::string& username, |
| 32 const base::string16& password_value) override; |
30 void SetPasswordList( | 33 void SetPasswordList( |
31 const ScopedVector<autofill::PasswordForm>& password_list, | 34 const ScopedVector<autofill::PasswordForm>& password_list, |
32 bool show_passwords) override; | 35 bool show_passwords) override; |
33 void SetPasswordExceptionList(const ScopedVector<autofill::PasswordForm>& | 36 void SetPasswordExceptionList(const ScopedVector<autofill::PasswordForm>& |
34 password_exception_list) override; | 37 password_exception_list) override; |
35 | 38 |
36 // Calls from Java. | 39 // Calls from Java. |
37 base::android::ScopedJavaLocalRef<jobject> GetSavedPasswordEntry( | 40 base::android::ScopedJavaLocalRef<jobject> GetSavedPasswordEntry( |
38 JNIEnv* env, jobject, int index); | 41 JNIEnv* env, jobject, int index); |
39 base::android::ScopedJavaLocalRef<jstring> | 42 base::android::ScopedJavaLocalRef<jstring> |
40 GetSavedPasswordException(JNIEnv* env, jobject, int index); | 43 GetSavedPasswordException(JNIEnv* env, jobject, int index); |
41 void UpdatePasswordLists(JNIEnv* env, jobject); | 44 void UpdatePasswordLists(JNIEnv* env, jobject); |
42 void HandleRemoveSavedPasswordEntry(JNIEnv* env, jobject, int index); | 45 void HandleRemoveSavedPasswordEntry(JNIEnv* env, jobject, int index); |
43 void HandleRemoveSavedPasswordException(JNIEnv* env, jobject, int index); | 46 void HandleRemoveSavedPasswordException(JNIEnv* env, jobject, int index); |
44 // Destroy the native implementation. | 47 // Destroy the native implementation. |
45 void Destroy(JNIEnv*, jobject); | 48 void Destroy(JNIEnv*, jobject); |
46 | 49 |
47 // JNI registration | 50 // JNI registration |
48 static bool RegisterPasswordUIViewAndroid(JNIEnv* env); | 51 static bool RegisterPasswordUIViewAndroid(JNIEnv* env); |
49 | 52 |
50 private: | 53 private: |
51 PasswordManagerPresenter password_manager_presenter_; | 54 PasswordManagerPresenter password_manager_presenter_; |
52 // Java side of UI controller. | 55 // Java side of UI controller. |
53 JavaObjectWeakGlobalRef weak_java_ui_controller_; | 56 JavaObjectWeakGlobalRef weak_java_ui_controller_; |
54 | 57 |
55 DISALLOW_COPY_AND_ASSIGN(PasswordUIViewAndroid); | 58 DISALLOW_COPY_AND_ASSIGN(PasswordUIViewAndroid); |
56 }; | 59 }; |
57 | 60 |
58 #endif // CHROME_BROWSER_ANDROID_PASSWORD_UI_VIEW_ANDROID_H_ | 61 #endif // CHROME_BROWSER_ANDROID_PASSWORD_UI_VIEW_ANDROID_H_ |
OLD | NEW |