| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 const Suggestion& suggestion = controller_->GetSuggestionAt(i); | 76 const Suggestion& suggestion = controller_->GetSuggestionAt(i); |
| 77 if (!suggestion.icon.empty()) { | 77 if (!suggestion.icon.empty()) { |
| 78 android_icon_id = ResourceMapper::MapFromChromiumId( | 78 android_icon_id = ResourceMapper::MapFromChromiumId( |
| 79 controller_->layout_model().GetIconResourceID(suggestion.icon)); | 79 controller_->layout_model().GetIconResourceID(suggestion.icon)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool deletable = | 82 bool deletable = |
| 83 controller_->GetRemovalConfirmationText(i, nullptr, nullptr); | 83 controller_->GetRemovalConfirmationText(i, nullptr, nullptr); |
| 84 bool is_label_multiline = | 84 bool is_label_multiline = |
| 85 suggestion.frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE; | 85 suggestion.frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE || |
| 86 suggestion.frontend_id == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO; |
| 86 Java_AutofillPopupBridge_addToAutofillSuggestionArray( | 87 Java_AutofillPopupBridge_addToAutofillSuggestionArray( |
| 87 env, data_array.obj(), i, value.obj(), label.obj(), android_icon_id, | 88 env, data_array.obj(), i, value.obj(), label.obj(), android_icon_id, |
| 88 suggestion.frontend_id, deletable, is_label_multiline); | 89 suggestion.frontend_id, deletable, is_label_multiline); |
| 89 } | 90 } |
| 90 | 91 |
| 91 Java_AutofillPopupBridge_show( | 92 Java_AutofillPopupBridge_show( |
| 92 env, java_object_.obj(), data_array.obj(), controller_->IsRTL()); | 93 env, java_object_.obj(), data_array.obj(), controller_->IsRTL()); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void AutofillPopupViewAndroid::SuggestionSelected( | 96 void AutofillPopupViewAndroid::SuggestionSelected( |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // static | 154 // static |
| 154 AutofillPopupView* AutofillPopupView::Create( | 155 AutofillPopupView* AutofillPopupView::Create( |
| 155 AutofillPopupController* controller) { | 156 AutofillPopupController* controller) { |
| 156 if (IsKeyboardAccessoryEnabled()) | 157 if (IsKeyboardAccessoryEnabled()) |
| 157 return new AutofillKeyboardAccessoryView(controller); | 158 return new AutofillKeyboardAccessoryView(controller); |
| 158 | 159 |
| 159 return new AutofillPopupViewAndroid(controller); | 160 return new AutofillPopupViewAndroid(controller); |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace autofill | 163 } // namespace autofill |
| OLD | NEW |