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 #include "chrome/browser/ui/android/autofill/autofill_popup_view_android.h" | 5 #include "chrome/browser/ui/android/autofill/autofill_popup_view_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "chrome/browser/android/resource_mapper.h" | 9 #include "chrome/browser/android/resource_mapper.h" |
10 #include "chrome/browser/ui/android/window_android_helper.h" | 10 #include "chrome/browser/ui/android/window_android_helper.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 AutofillPopupViewAndroid::~AutofillPopupViewAndroid() {} | 27 AutofillPopupViewAndroid::~AutofillPopupViewAndroid() {} |
28 | 28 |
29 void AutofillPopupViewAndroid::Show() { | 29 void AutofillPopupViewAndroid::Show() { |
30 JNIEnv* env = base::android::AttachCurrentThread(); | 30 JNIEnv* env = base::android::AttachCurrentThread(); |
31 ui::ViewAndroid* view_android = controller_->container_view(); | 31 ui::ViewAndroid* view_android = controller_->container_view(); |
32 | 32 |
33 DCHECK(view_android); | 33 DCHECK(view_android); |
34 | 34 |
35 java_object_.Reset(Java_AutofillPopupBridge_create( | 35 java_object_.Reset(Java_AutofillPopupBridge_create( |
36 env, | 36 env, reinterpret_cast<intptr_t>(this), |
37 reinterpret_cast<intptr_t>(this), | |
38 view_android->GetWindowAndroid()->GetJavaObject().obj(), | 37 view_android->GetWindowAndroid()->GetJavaObject().obj(), |
39 view_android->GetJavaObject().obj())); | 38 view_android->GetViewAndroidDelegate().obj())); |
40 | 39 |
41 UpdateBoundsAndRedrawPopup(); | 40 UpdateBoundsAndRedrawPopup(); |
42 } | 41 } |
43 | 42 |
44 void AutofillPopupViewAndroid::Hide() { | 43 void AutofillPopupViewAndroid::Hide() { |
45 controller_ = NULL; | 44 controller_ = NULL; |
46 JNIEnv* env = base::android::AttachCurrentThread(); | 45 JNIEnv* env = base::android::AttachCurrentThread(); |
47 Java_AutofillPopupBridge_dismiss(env, java_object_.obj()); | 46 Java_AutofillPopupBridge_dismiss(env, java_object_.obj()); |
48 } | 47 } |
49 | 48 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return RegisterNativesImpl(env); | 110 return RegisterNativesImpl(env); |
112 } | 111 } |
113 | 112 |
114 // static | 113 // static |
115 AutofillPopupView* AutofillPopupView::Create( | 114 AutofillPopupView* AutofillPopupView::Create( |
116 AutofillPopupController* controller) { | 115 AutofillPopupController* controller) { |
117 return new AutofillPopupViewAndroid(controller); | 116 return new AutofillPopupViewAndroid(controller); |
118 } | 117 } |
119 | 118 |
120 } // namespace autofill | 119 } // namespace autofill |
OLD | NEW |