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

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: dont break android 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
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller.h » ('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) 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 Java_AutofillDialogGlue_addToAutofillDialogFieldArray( 138 Java_AutofillDialogGlue_addToAutofillDialogFieldArray(
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_->MenuModelForSectionHack(section);
149 const int itemCount = menuModel->GetItemCount(); 149 const int itemCount = menuModel->GetItemCount();
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;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 base::android::AppendJavaStringArrayToStringVector( 271 base::android::AppendJavaStringArrayToStringVector(
272 env, jaccount_names.obj(), &account_names); 272 env, jaccount_names.obj(), &account_names);
273 return account_names; 273 return account_names;
274 } 274 }
275 275
276 // Calls from Java to C++ 276 // Calls from Java to C++
277 277
278 void AutofillDialogViewAndroid::ItemSelected(JNIEnv* env, jobject obj, 278 void AutofillDialogViewAndroid::ItemSelected(JNIEnv* env, jobject obj,
279 jint section, jint index) { 279 jint section, jint index) {
280 ui::MenuModel* menuModel = 280 ui::MenuModel* menuModel =
281 controller_->MenuModelForSection(static_cast<DialogSection>(section)); 281 controller_->MenuModelForSection(static_cast<DialogSection>(section));
aruslan 2013/04/30 21:46:57 Please change this as well.
282 menuModel->ActivatedAt(index); 282 menuModel->ActivatedAt(index);
283 } 283 }
284 284
285 ScopedJavaLocalRef<jobject> AutofillDialogViewAndroid::GetIconForField( 285 ScopedJavaLocalRef<jobject> AutofillDialogViewAndroid::GetIconForField(
286 JNIEnv* env, 286 JNIEnv* env,
287 jobject obj, 287 jobject obj,
288 jint field_id, 288 jint field_id,
289 jstring jinput) { 289 jstring jinput) {
290 string16 input = base::android::ConvertJavaStringToUTF16(env, jinput); 290 string16 input = base::android::ConvertJavaStringToUTF16(env, jinput);
291 gfx::Image icon = controller_-> 291 gfx::Image icon = controller_->
(...skipping 209 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
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698