Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: chrome/browser/ui/android/autofill/autofill_popup_view_android.cc

Issue 2627153007: Fix styling of Form-Not-Secure warnings on Android (Closed)
Patch Set: actually set the icon size Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/android/java/res/values/colors.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chrome/browser/ui/android/autofill/autofill_keyboard_accessory_view.h" 11 #include "chrome/browser/ui/android/autofill/autofill_keyboard_accessory_view.h"
12 #include "chrome/browser/ui/android/view_android_helper.h" 12 #include "chrome/browser/ui/android/view_android_helper.h"
13 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" 13 #include "chrome/browser/ui/autofill/autofill_popup_controller.h"
14 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" 14 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h"
15 #include "components/autofill/core/browser/popup_item_ids.h" 15 #include "components/autofill/core/browser/popup_item_ids.h"
16 #include "components/autofill/core/browser/suggestion.h" 16 #include "components/autofill/core/browser/suggestion.h"
17 #include "components/autofill/core/common/autofill_util.h" 17 #include "components/autofill/core/common/autofill_util.h"
18 #include "components/security_state/core/security_state.h"
18 #include "content/public/browser/android/content_view_core.h" 19 #include "content/public/browser/android/content_view_core.h"
19 #include "jni/AutofillPopupBridge_jni.h" 20 #include "jni/AutofillPopupBridge_jni.h"
20 #include "ui/android/view_android.h" 21 #include "ui/android/view_android.h"
21 #include "ui/android/window_android.h" 22 #include "ui/android/window_android.h"
22 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
23 #include "ui/gfx/android/java_bitmap.h" 24 #include "ui/gfx/android/java_bitmap.h"
24 #include "ui/gfx/geometry/rect_f.h" 25 #include "ui/gfx/geometry/rect_f.h"
25 26
26 using base::android::JavaParamRef; 27 using base::android::JavaParamRef;
27 using base::android::ScopedJavaLocalRef; 28 using base::android::ScopedJavaLocalRef;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 int android_icon_id = 0; 90 int android_icon_id = 0;
90 91
91 const Suggestion& suggestion = controller_->GetSuggestionAt(i); 92 const Suggestion& suggestion = controller_->GetSuggestionAt(i);
92 if (!suggestion.icon.empty()) { 93 if (!suggestion.icon.empty()) {
93 android_icon_id = ResourceMapper::MapFromChromiumId( 94 android_icon_id = ResourceMapper::MapFromChromiumId(
94 controller_->layout_model().GetIconResourceID(suggestion.icon)); 95 controller_->layout_model().GetIconResourceID(suggestion.icon));
95 } 96 }
96 97
97 bool is_deletable = 98 bool is_deletable =
98 controller_->GetRemovalConfirmationText(i, nullptr, nullptr); 99 controller_->GetRemovalConfirmationText(i, nullptr, nullptr);
100 // In the Form-Not-Secure experiment, the payment disabled message
101 // is a short message that should be displayed the same as the other
102 // autofill suggestions. If this experiment is not enabled, then the
103 // payment disabled message should be allowed to span multiple
104 // lines.
99 bool is_label_multiline = 105 bool is_label_multiline =
100 suggestion.frontend_id == 106 (!security_state::IsHttpWarningInFormEnabled() &&
101 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE || 107 suggestion.frontend_id ==
108 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE) ||
102 suggestion.frontend_id == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO; 109 suggestion.frontend_id == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO;
103 Java_AutofillPopupBridge_addToAutofillSuggestionArray( 110 Java_AutofillPopupBridge_addToAutofillSuggestionArray(
104 env, data_array, i, value, label, android_icon_id, 111 env, data_array, i, value, label, android_icon_id,
105 controller_->layout_model().IsIconAtStart(suggestion.frontend_id), 112 controller_->layout_model().IsIconAtStart(suggestion.frontend_id),
106 suggestion.frontend_id, is_deletable, is_label_multiline, 113 suggestion.frontend_id, is_deletable, is_label_multiline,
107 suggestion.is_value_bold); 114 suggestion.is_value_bold);
108 } 115 }
109 116
110 Java_AutofillPopupBridge_show( 117 Java_AutofillPopupBridge_show(
111 env, java_object_, data_array, controller_->IsRTL(), 118 env, java_object_, data_array, controller_->IsRTL(),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // static 179 // static
173 AutofillPopupView* AutofillPopupView::Create( 180 AutofillPopupView* AutofillPopupView::Create(
174 AutofillPopupController* controller) { 181 AutofillPopupController* controller) {
175 if (IsKeyboardAccessoryEnabled()) 182 if (IsKeyboardAccessoryEnabled())
176 return new AutofillKeyboardAccessoryView(controller); 183 return new AutofillKeyboardAccessoryView(controller);
177 184
178 return new AutofillPopupViewAndroid(controller); 185 return new AutofillPopupViewAndroid(controller);
179 } 186 }
180 187
181 } // namespace autofill 188 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/android/java/res/values/colors.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698