OLD | NEW |
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 package org.chromium.chrome.browser.autofill; | 5 package org.chromium.chrome.browser.autofill; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.drawable.BitmapDrawable; | 10 import android.graphics.drawable.BitmapDrawable; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 | 227 |
228 /** | 228 /** |
229 * @return The current section if we are in editing mode, INVALID_SECTION ot
herwise. | 229 * @return The current section if we are in editing mode, INVALID_SECTION ot
herwise. |
230 */ | 230 */ |
231 public int getCurrentSection() { | 231 public int getCurrentSection() { |
232 return getSectionForLayoutMode(mCurrentLayout); | 232 return getSectionForLayoutMode(mCurrentLayout); |
233 } | 233 } |
234 | 234 |
235 /** | 235 /** |
| 236 * Updates the legal documents footer. |
| 237 * @param legalDocumentsText The text to show, or a null/empty string. |
| 238 */ |
| 239 public void updateLegalDocumentsText(String legalDocumentsText) { |
| 240 TextView legalView = (TextView) findViewById(R.id.terms_info); |
| 241 if (TextUtils.isEmpty(legalDocumentsText)) { |
| 242 legalView.setVisibility(View.GONE); |
| 243 return; |
| 244 } |
| 245 |
| 246 legalView.setText(legalDocumentsText); |
| 247 legalView.setVisibility(View.VISIBLE); |
| 248 } |
| 249 |
| 250 /** |
236 * Updates a dropdown with the given items and adds default items to the end
. | 251 * Updates a dropdown with the given items and adds default items to the end
. |
237 * @param section The dialog section. | 252 * @param section The dialog section. |
238 * @param items The {@link AutofillDialogMenuItem} array to update the dropd
own with. | 253 * @param items The {@link AutofillDialogMenuItem} array to update the dropd
own with. |
239 * @param selectedMenuItem The index of the selected menu item, or -1. | 254 * @param selectedMenuItem The index of the selected menu item, or -1. |
240 */ | 255 */ |
241 public void updateMenuItemsForSection(int section, | 256 public void updateMenuItemsForSection(int section, |
242 List<AutofillDialogMenuItem> items, final int selectedMenuItem) { | 257 List<AutofillDialogMenuItem> items, final int selectedMenuItem) { |
243 final Spinner spinner = mSpinners[section]; | 258 final Spinner spinner = mSpinners[section]; |
244 // Set the listener to null and reset it after updating the menu items t
o avoid getting an | 259 // Set the listener to null and reset it after updating the menu items t
o avoid getting an |
245 // onItemSelected call when the first item is selected after updating th
e items. | 260 // onItemSelected call when the first item is selected after updating th
e items. |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 cvcEdit.setVisibility(VISIBLE); | 541 cvcEdit.setVisibility(VISIBLE); |
527 if (!TextUtils.isEmpty(mCVCHint)) { | 542 if (!TextUtils.isEmpty(mCVCHint)) { |
528 cvcEdit.setHint(mCVCHint); | 543 cvcEdit.setHint(mCVCHint); |
529 } | 544 } |
530 cvcEdit.setCompoundDrawables(null, null, mCVCIcon, null); | 545 cvcEdit.setCompoundDrawables(null, null, mCVCIcon, null); |
531 } | 546 } |
532 return spinnerView; | 547 return spinnerView; |
533 } | 548 } |
534 } | 549 } |
535 } | 550 } |
OLD | NEW |