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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java

Issue 1842223003: Remove outdated devices from Android device chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test for ItemChooserDialog Created 4 years, 8 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
OLDNEW
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.Manifest; 7 import android.Manifest;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.pm.PackageManager; 10 import android.content.pm.PackageManager;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 @VisibleForTesting 278 @VisibleForTesting
279 @CalledByNative 279 @CalledByNative
280 void closeDialog() { 280 void closeDialog() {
281 mNativeBluetoothChooserDialogPtr = 0; 281 mNativeBluetoothChooserDialogPtr = 0;
282 mItemChooserDialog.dismiss(); 282 mItemChooserDialog.dismiss();
283 } 283 }
284 284
285 @VisibleForTesting 285 @VisibleForTesting
286 @CalledByNative 286 @CalledByNative
287 void removeDevice(String deviceId) {
288 mItemChooserDialog.setEnabled(deviceId, false);
289 }
290
291 @VisibleForTesting
292 @CalledByNative
293 void notifyAdapterTurnedOff() { 287 void notifyAdapterTurnedOff() {
294 SpannableString adapterOffMessage = SpanApplier.applySpans( 288 SpannableString adapterOffMessage = SpanApplier.applySpans(
295 mContext.getString(R.string.bluetooth_adapter_off), 289 mContext.getString(R.string.bluetooth_adapter_off),
296 new SpanInfo("<link>", "</link>", 290 new SpanInfo("<link>", "</link>",
297 new BluetoothClickableSpan(LinkType.ADAPTER_OFF, mContex t))); 291 new BluetoothClickableSpan(LinkType.ADAPTER_OFF, mContex t)));
298 SpannableString adapterOffStatus = SpanApplier.applySpans( 292 SpannableString adapterOffStatus = SpanApplier.applySpans(
299 mContext.getString(R.string.bluetooth_adapter_off_help), 293 mContext.getString(R.string.bluetooth_adapter_off_help),
300 new SpanInfo("<link>", "</link>", 294 new SpanInfo("<link>", "</link>",
301 new BluetoothClickableSpan(LinkType.ADAPTER_OFF_HELP, mC ontext))); 295 new BluetoothClickableSpan(LinkType.ADAPTER_OFF_HELP, mC ontext)));
302 296
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 @VisibleForTesting 332 @VisibleForTesting
339 native void nativeRestartSearch(long nativeBluetoothChooserAndroid); 333 native void nativeRestartSearch(long nativeBluetoothChooserAndroid);
340 // Help links. 334 // Help links.
341 @VisibleForTesting 335 @VisibleForTesting
342 native void nativeShowBluetoothOverviewLink(long nativeBluetoothChooserAndro id); 336 native void nativeShowBluetoothOverviewLink(long nativeBluetoothChooserAndro id);
343 @VisibleForTesting 337 @VisibleForTesting
344 native void nativeShowBluetoothAdapterOffLink(long nativeBluetoothChooserAnd roid); 338 native void nativeShowBluetoothAdapterOffLink(long nativeBluetoothChooserAnd roid);
345 @VisibleForTesting 339 @VisibleForTesting
346 native void nativeShowNeedLocationPermissionLink(long nativeBluetoothChooser Android); 340 native void nativeShowNeedLocationPermissionLink(long nativeBluetoothChooser Android);
347 } 341 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698