OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.Dialog; | 8 import android.app.Dialog; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.DialogInterface; | 10 import android.content.DialogInterface; |
(...skipping 20 matching lines...) Expand all Loading... |
31 import org.chromium.chrome.R; | 31 import org.chromium.chrome.R; |
32 import org.chromium.chrome.browser.util.MathUtils; | 32 import org.chromium.chrome.browser.util.MathUtils; |
33 import org.chromium.ui.base.DeviceFormFactor; | 33 import org.chromium.ui.base.DeviceFormFactor; |
34 import org.chromium.ui.widget.TextViewWithClickableSpans; | 34 import org.chromium.ui.widget.TextViewWithClickableSpans; |
35 | 35 |
36 import java.util.HashSet; | 36 import java.util.HashSet; |
37 import java.util.Set; | 37 import java.util.Set; |
38 | 38 |
39 /** | 39 /** |
40 * A general-purpose dialog for presenting a list of things to pick from. | 40 * A general-purpose dialog for presenting a list of things to pick from. |
| 41 * |
| 42 * The dialog is shown by the ItemChooserDialog constructor, and always calls |
| 43 * ItemSelectedCallback.onItemSelected() as it's closing. |
41 */ | 44 */ |
42 public class ItemChooserDialog { | 45 public class ItemChooserDialog { |
43 /** | 46 /** |
44 * An interface to implement to get a callback when something has been | 47 * An interface to implement to get a callback when something has been |
45 * selected. | 48 * selected. |
46 */ | 49 */ |
47 public interface ItemSelectedCallback { | 50 public interface ItemSelectedCallback { |
48 /** | 51 /** |
49 * Returns the user selection. | 52 * Returns the user selection. |
50 * | 53 * |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } | 450 } |
448 | 451 |
449 /** | 452 /** |
450 * Returns the ItemAdapter associated with this class. For use with tests on
ly. | 453 * Returns the ItemAdapter associated with this class. For use with tests on
ly. |
451 */ | 454 */ |
452 @VisibleForTesting | 455 @VisibleForTesting |
453 public ItemAdapter getItemAdapterForTesting() { | 456 public ItemAdapter getItemAdapterForTesting() { |
454 return mItemAdapter; | 457 return mItemAdapter; |
455 } | 458 } |
456 } | 459 } |
OLD | NEW |