| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_ANDROID_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_ANDROI
D_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_ANDROI
D_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_ANDROI
D_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_ANDROI
D_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" | 12 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 15 | 15 |
| 16 class PasswordGenerationPopupController; | 16 class PasswordGenerationPopupController; |
| 17 | 17 |
| 18 // The android implementation of the password generation UI. | 18 // The android implementation of the password generation UI. |
| 19 class PasswordGenerationPopupViewAndroid : public PasswordGenerationPopupView { | 19 class PasswordGenerationPopupViewAndroid : public PasswordGenerationPopupView { |
| 20 public: | 20 public: |
| 21 // Builds the UI for the |controller|. | 21 // Builds the UI for the |controller|. |
| 22 explicit PasswordGenerationPopupViewAndroid( | 22 explicit PasswordGenerationPopupViewAndroid( |
| 23 PasswordGenerationPopupController* controller); | 23 PasswordGenerationPopupController* controller); |
| 24 | 24 |
| 25 // Called from JNI when the "saved passwords" link was clicked. | 25 // Called from JNI when the "saved passwords" link was clicked. |
| 26 void SavedPasswordsLinkClicked(JNIEnv* env, jobject obj); | 26 void SavedPasswordsLinkClicked( |
| 27 JNIEnv* env, |
| 28 const base::android::JavaParamRef<jobject>& obj); |
| 27 | 29 |
| 28 // Called from JNI when the popup was dismissed. | 30 // Called from JNI when the popup was dismissed. |
| 29 void Dismissed(JNIEnv* env, jobject obj); | 31 void Dismissed(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 30 | 32 |
| 31 // Called from JNI when the suggested password was selected. | 33 // Called from JNI when the suggested password was selected. |
| 32 void PasswordSelected(JNIEnv* env, jobject object); | 34 void PasswordSelected(JNIEnv* env, |
| 35 const base::android::JavaParamRef<jobject>& object); |
| 33 | 36 |
| 34 // Registers the popup with JNI. | 37 // Registers the popup with JNI. |
| 35 static bool Register(JNIEnv* env); | 38 static bool Register(JNIEnv* env); |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 // The popup owns itself. | 41 // The popup owns itself. |
| 39 virtual ~PasswordGenerationPopupViewAndroid(); | 42 virtual ~PasswordGenerationPopupViewAndroid(); |
| 40 | 43 |
| 41 // PasswordGenerationPopupView implementation. | 44 // PasswordGenerationPopupView implementation. |
| 42 void Show() override; | 45 void Show() override; |
| 43 void Hide() override; | 46 void Hide() override; |
| 44 gfx::Size GetPreferredSizeOfPasswordView() override; | 47 gfx::Size GetPreferredSizeOfPasswordView() override; |
| 45 void UpdateBoundsAndRedrawPopup() override; | 48 void UpdateBoundsAndRedrawPopup() override; |
| 46 void PasswordSelectionUpdated() override; | 49 void PasswordSelectionUpdated() override; |
| 47 bool IsPointInPasswordBounds(const gfx::Point& point) override; | 50 bool IsPointInPasswordBounds(const gfx::Point& point) override; |
| 48 | 51 |
| 49 // Weak pointer to the controller. | 52 // Weak pointer to the controller. |
| 50 PasswordGenerationPopupController* controller_; | 53 PasswordGenerationPopupController* controller_; |
| 51 | 54 |
| 52 // The corresponding java object. | 55 // The corresponding java object. |
| 53 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 56 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupViewAndroid); | 58 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupViewAndroid); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 } // namespace autofill | 61 } // namespace autofill |
| 59 | 62 |
| 60 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_AND
ROID_H_ | 63 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_PASSWORD_GENERATION_POPUP_VIEW_AND
ROID_H_ |
| OLD | NEW |