| 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/ui/android/window_android_helper.h" | 9 #include "chrome/browser/ui/android/window_android_helper.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
| 11 #include "content/public/browser/android/content_view_core.h" | 11 #include "content/public/browser/android/content_view_core.h" |
| 12 #include "jni/AutofillPopupGlue_jni.h" | 12 #include "jni/AutofillPopupGlue_jni.h" |
| 13 #include "ui/gfx/android/window_android.h" | 13 #include "ui/gfx/android/window_android.h" |
| 14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 15 | 15 |
| 16 using base::android::MethodID; | 16 using base::android::MethodID; |
| 17 | 17 |
| 18 AutofillPopupViewAndroid::AutofillPopupViewAndroid( | 18 AutofillPopupViewAndroid::AutofillPopupViewAndroid( |
| 19 AutofillPopupController* controller) | 19 AutofillPopupController* controller) |
| 20 : controller_(controller) {} | 20 : controller_(controller) {} |
| 21 | 21 |
| 22 AutofillPopupViewAndroid::~AutofillPopupViewAndroid() { | 22 AutofillPopupViewAndroid::~AutofillPopupViewAndroid() {} |
| 23 controller_->ViewDestroyed(); | |
| 24 } | |
| 25 | 23 |
| 26 void AutofillPopupViewAndroid::Show() { | 24 void AutofillPopupViewAndroid::Show() { |
| 27 JNIEnv* env = base::android::AttachCurrentThread(); | 25 JNIEnv* env = base::android::AttachCurrentThread(); |
| 28 content::ContentViewCore* content_view_core = controller_->container_view(); | 26 content::ContentViewCore* content_view_core = controller_->container_view(); |
| 29 | 27 |
| 30 java_object_.Reset(Java_AutofillPopupGlue_create( | 28 java_object_.Reset(Java_AutofillPopupGlue_create( |
| 31 env, | 29 env, |
| 32 reinterpret_cast<jint>(this), | 30 reinterpret_cast<jint>(this), |
| 33 content_view_core->GetWindowAndroid()->GetJavaObject().obj(), | 31 content_view_core->GetWindowAndroid()->GetJavaObject().obj(), |
| 34 content_view_core->GetContainerViewDelegate().obj())); | 32 content_view_core->GetContainerViewDelegate().obj())); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // static | 91 // static |
| 94 bool AutofillPopupViewAndroid::RegisterAutofillPopupViewAndroid(JNIEnv* env) { | 92 bool AutofillPopupViewAndroid::RegisterAutofillPopupViewAndroid(JNIEnv* env) { |
| 95 return RegisterNativesImpl(env); | 93 return RegisterNativesImpl(env); |
| 96 } | 94 } |
| 97 | 95 |
| 98 // static | 96 // static |
| 99 AutofillPopupView* AutofillPopupView::Create( | 97 AutofillPopupView* AutofillPopupView::Create( |
| 100 AutofillPopupController* controller) { | 98 AutofillPopupController* controller) { |
| 101 return new AutofillPopupViewAndroid(controller); | 99 return new AutofillPopupViewAndroid(controller); |
| 102 } | 100 } |
| OLD | NEW |