| 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 "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/android/resource_mapper.h" | 10 #include "chrome/browser/android/resource_mapper.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 AutofillPopupViewAndroid::AutofillPopupViewAndroid( | 26 AutofillPopupViewAndroid::AutofillPopupViewAndroid( |
| 27 AutofillPopupController* controller) | 27 AutofillPopupController* controller) |
| 28 : controller_(controller), | 28 : controller_(controller), |
| 29 deleting_index_(-1) {} | 29 deleting_index_(-1) {} |
| 30 | 30 |
| 31 AutofillPopupViewAndroid::~AutofillPopupViewAndroid() {} | 31 AutofillPopupViewAndroid::~AutofillPopupViewAndroid() {} |
| 32 | 32 |
| 33 void AutofillPopupViewAndroid::Show() { | 33 void AutofillPopupViewAndroid::Show() { |
| 34 JNIEnv* env = base::android::AttachCurrentThread(); | 34 JNIEnv* env = base::android::AttachCurrentThread(); |
| 35 ui::ViewAndroid* view_android = controller_->container_view(); | 35 ui::ViewAndroid* view_android = |
| 36 (ui::ViewAndroid*) controller_->container_view(); |
| 36 | 37 |
| 37 DCHECK(view_android); | 38 DCHECK(view_android); |
| 38 | 39 |
| 39 java_object_.Reset(Java_AutofillPopupBridge_create( | 40 java_object_.Reset(Java_AutofillPopupBridge_create( |
| 40 env, reinterpret_cast<intptr_t>(this), | 41 env, reinterpret_cast<intptr_t>(this), |
| 41 view_android->GetWindowAndroid()->GetJavaObject().obj(), | 42 view_android->GetWindowAndroid()->GetJavaObject().obj(), |
| 42 view_android->GetViewAndroidDelegate().obj())); | 43 view_android->GetViewAndroidDelegate().obj())); |
| 43 | 44 |
| 44 UpdateBoundsAndRedrawPopup(); | 45 UpdateBoundsAndRedrawPopup(); |
| 45 } | 46 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 AutofillPopupController* controller) { | 154 AutofillPopupController* controller) { |
| 154 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 155 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 155 switches::kEnableAccessorySuggestionView)) { | 156 switches::kEnableAccessorySuggestionView)) { |
| 156 return new AutofillKeyboardAccessoryView(controller); | 157 return new AutofillKeyboardAccessoryView(controller); |
| 157 } | 158 } |
| 158 | 159 |
| 159 return new AutofillPopupViewAndroid(controller); | 160 return new AutofillPopupViewAndroid(controller); |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace autofill | 163 } // namespace autofill |
| OLD | NEW |