OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.text.SpannableString; | 8 import android.text.SpannableString; |
9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
10 import android.view.View; | 10 import android.view.View; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 view.invalidate(); | 83 view.invalidate(); |
84 } | 84 } |
85 })); | 85 })); |
86 SpannableString statusIdleNoneFound = statusActive; | 86 SpannableString statusIdleNoneFound = statusActive; |
87 SpannableString statusIdleSomeFound = statusActive; | 87 SpannableString statusIdleSomeFound = statusActive; |
88 String positiveButton = activity.getString(R.string.usb_chooser_dialog_c
onnect_button_text); | 88 String positiveButton = activity.getString(R.string.usb_chooser_dialog_c
onnect_button_text); |
89 | 89 |
90 ItemChooserDialog.ItemChooserLabels labels = | 90 ItemChooserDialog.ItemChooserLabels labels = |
91 new ItemChooserDialog.ItemChooserLabels(title, searching, noneFo
und, statusActive, | 91 new ItemChooserDialog.ItemChooserLabels(title, searching, noneFo
und, statusActive, |
92 statusIdleNoneFound, statusIdleSomeFound, positiveButton
); | 92 statusIdleNoneFound, statusIdleSomeFound, positiveButton
); |
93 mItemChooserDialog = new ItemChooserDialog(activity, this, labels); | 93 mItemChooserDialog = new ItemChooserDialog(activity, this, labels, false
/* usingIcon */); |
94 } | 94 } |
95 | 95 |
96 @Override | 96 @Override |
97 public void onItemSelected(String id) { | 97 public void onItemSelected(String id) { |
98 if (mNativeUsbChooserDialogPtr != 0) { | 98 if (mNativeUsbChooserDialogPtr != 0) { |
99 if (id.isEmpty()) { | 99 if (id.isEmpty()) { |
100 nativeOnDialogCancelled(mNativeUsbChooserDialogPtr); | 100 nativeOnDialogCancelled(mNativeUsbChooserDialogPtr); |
101 } else { | 101 } else { |
102 nativeOnItemSelected(mNativeUsbChooserDialogPtr, id); | 102 nativeOnItemSelected(mNativeUsbChooserDialogPtr, id); |
103 } | 103 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 mItemChooserDialog.dismiss(); | 141 mItemChooserDialog.dismiss(); |
142 } | 142 } |
143 | 143 |
144 @VisibleForTesting | 144 @VisibleForTesting |
145 native void nativeOnItemSelected(long nativeUsbChooserDialogAndroid, String
deviceId); | 145 native void nativeOnItemSelected(long nativeUsbChooserDialogAndroid, String
deviceId); |
146 @VisibleForTesting | 146 @VisibleForTesting |
147 native void nativeOnDialogCancelled(long nativeUsbChooserDialogAndroid); | 147 native void nativeOnDialogCancelled(long nativeUsbChooserDialogAndroid); |
148 @VisibleForTesting | 148 @VisibleForTesting |
149 native void nativeLoadUsbHelpPage(long nativeUsbChooserDialogAndroid); | 149 native void nativeLoadUsbHelpPage(long nativeUsbChooserDialogAndroid); |
150 } | 150 } |
OLD | NEW |