| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_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/autofill_popup_view.h" | 12 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| 13 | 13 |
| 14 class AutofillPopupController; | 14 class AutofillPopupController; |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Rect; | 17 class Rect; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class AutofillPopupViewAndroid : public AutofillPopupView { | 20 class AutofillPopupViewAndroid : public AutofillPopupView { |
| 21 public: | 21 public: |
| 22 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); | 22 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); |
| 23 | 23 |
| 24 // -------------------------------------------------------------------------- | 24 // -------------------------------------------------------------------------- |
| 25 // Methods called from Java via JNI | 25 // Methods called from Java via JNI |
| 26 // -------------------------------------------------------------------------- | 26 // -------------------------------------------------------------------------- |
| 27 // Called when an autofill item was selected. | 27 // Called when an autofill item was selected. |
| 28 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); | 28 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); |
| 29 | 29 |
| 30 void Dismissed(JNIEnv *env, jobject obj); | 30 void RequestHide(JNIEnv* env, jobject obj); |
| 31 | 31 |
| 32 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); | 32 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 // AutofillPopupView implementation. | 35 // AutofillPopupView implementation. |
| 36 virtual void Show() OVERRIDE; | 36 virtual void Show() OVERRIDE; |
| 37 virtual void Hide() OVERRIDE; | 37 virtual void Hide() OVERRIDE; |
| 38 virtual void InvalidateRow(size_t row) OVERRIDE; | 38 virtual void InvalidateRow(size_t row) OVERRIDE; |
| 39 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; | 39 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 virtual ~AutofillPopupViewAndroid(); | 42 virtual ~AutofillPopupViewAndroid(); |
| 43 | 43 |
| 44 AutofillPopupController* controller_; // weak. | 44 AutofillPopupController* controller_; // weak. |
| 45 | 45 |
| 46 // The corresponding java object. | 46 // The corresponding java object. |
| 47 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 47 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); | 49 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 52 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ |
| OLD | NEW |