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

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

Issue 14571003: Don't display drop down arrows in rAc dialog unless there is a suggestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update tests Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_dialog_view_android.h" 5 #include "chrome/browser/ui/android/autofill/autofill_dialog_view_android.h"
6 #include "base/android/jni_android.h" 6 #include "base/android/jni_android.h"
7 #include "base/android/jni_array.h" 7 #include "base/android/jni_array.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 env, 139 env,
140 field_array.obj(), 140 field_array.obj(),
141 i, 141 i,
142 reinterpret_cast<jint>(&input), 142 reinterpret_cast<jint>(&input),
143 input.type, 143 input.type,
144 placeholder.obj(), 144 placeholder.obj(),
145 autofilled.obj()); 145 autofilled.obj());
146 } 146 }
147 147
148 ui::MenuModel* menuModel = controller_->MenuModelForSection(section); 148 ui::MenuModel* menuModel = controller_->MenuModelForSection(section);
149 const int itemCount = menuModel->GetItemCount(); 149 const int itemCount = menuModel ? menuModel->GetItemCount() : 0;
150 ScopedJavaLocalRef<jobjectArray> menu_array = 150 ScopedJavaLocalRef<jobjectArray> menu_array =
151 Java_AutofillDialogGlue_createAutofillDialogMenuItemArray(env, 151 Java_AutofillDialogGlue_createAutofillDialogMenuItemArray(env,
152 itemCount); 152 itemCount);
153 153
154 int checkedItem = -1; 154 int checkedItem = -1;
155 155
156 for (int i = 0; i < itemCount; ++i) { 156 for (int i = 0; i < itemCount; ++i) {
157 if (menuModel->IsItemCheckedAt(i)) 157 if (menuModel->IsItemCheckedAt(i))
158 checkedItem = i; 158 checkedItem = i;
159 159
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 } 501 }
502 502
503 void AutofillDialogViewAndroid::UpdateSaveLocallyCheckBox() { 503 void AutofillDialogViewAndroid::UpdateSaveLocallyCheckBox() {
504 // TODO(aruslan) : Call this when at least one section is being edited. 504 // TODO(aruslan) : Call this when at least one section is being edited.
505 JNIEnv* env = base::android::AttachCurrentThread(); 505 JNIEnv* env = base::android::AttachCurrentThread();
506 Java_AutofillDialogGlue_updateSaveLocallyCheckBox( 506 Java_AutofillDialogGlue_updateSaveLocallyCheckBox(
507 env, java_object_.obj(), controller_->ShouldOfferToSaveInChrome()); 507 env, java_object_.obj(), controller_->ShouldOfferToSaveInChrome());
508 } 508 }
509 509
510 } // namespace autofill 510 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698