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 #include "chrome/browser/ui/android/autofill/password_generation_popup_view_andr
oid.h" | 5 #include "chrome/browser/ui/android/autofill/password_generation_popup_view_andr
oid.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 PasswordGenerationPopupViewAndroid::~PasswordGenerationPopupViewAndroid() {} | 52 PasswordGenerationPopupViewAndroid::~PasswordGenerationPopupViewAndroid() {} |
53 | 53 |
54 void PasswordGenerationPopupViewAndroid::Show() { | 54 void PasswordGenerationPopupViewAndroid::Show() { |
55 JNIEnv* env = base::android::AttachCurrentThread(); | 55 JNIEnv* env = base::android::AttachCurrentThread(); |
56 ui::ViewAndroid* view_android = controller_->container_view(); | 56 ui::ViewAndroid* view_android = controller_->container_view(); |
57 | 57 |
58 DCHECK(view_android); | 58 DCHECK(view_android); |
59 | 59 |
60 java_object_.Reset(Java_PasswordGenerationPopupBridge_create( | 60 java_object_.Reset(Java_PasswordGenerationPopupBridge_create( |
61 env, | 61 env, reinterpret_cast<intptr_t>(this), |
62 reinterpret_cast<intptr_t>(this), | |
63 view_android->GetWindowAndroid()->GetJavaObject().obj(), | 62 view_android->GetWindowAndroid()->GetJavaObject().obj(), |
64 view_android->GetJavaObject().obj())); | 63 view_android->GetViewAndroidDelegate().obj())); |
65 | 64 |
66 UpdateBoundsAndRedrawPopup(); | 65 UpdateBoundsAndRedrawPopup(); |
67 } | 66 } |
68 | 67 |
69 void PasswordGenerationPopupViewAndroid::Hide() { | 68 void PasswordGenerationPopupViewAndroid::Hide() { |
70 controller_ = NULL; | 69 controller_ = NULL; |
71 JNIEnv* env = base::android::AttachCurrentThread(); | 70 JNIEnv* env = base::android::AttachCurrentThread(); |
72 Java_PasswordGenerationPopupBridge_hide(env, java_object_.obj()); | 71 Java_PasswordGenerationPopupBridge_hide(env, java_object_.obj()); |
73 } | 72 } |
74 | 73 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return false; | 114 return false; |
116 } | 115 } |
117 | 116 |
118 // static | 117 // static |
119 PasswordGenerationPopupView* PasswordGenerationPopupView::Create( | 118 PasswordGenerationPopupView* PasswordGenerationPopupView::Create( |
120 PasswordGenerationPopupController* controller) { | 119 PasswordGenerationPopupController* controller) { |
121 return new PasswordGenerationPopupViewAndroid(controller); | 120 return new PasswordGenerationPopupViewAndroid(controller); |
122 } | 121 } |
123 | 122 |
124 } // namespace autofill | 123 } // namespace autofill |
OLD | NEW |