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.Manifest; | 7 import android.Manifest; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 mActivity.getString(R.string.bluetooth_adapter_off_help), | 300 mActivity.getString(R.string.bluetooth_adapter_off_help), |
301 new SpanInfo("<link>", "</link>", | 301 new SpanInfo("<link>", "</link>", |
302 new BluetoothClickableSpan(LinkType.ADAPTER_OFF_HELP, mA
ctivity))); | 302 new BluetoothClickableSpan(LinkType.ADAPTER_OFF_HELP, mA
ctivity))); |
303 | 303 |
304 mItemChooserDialog.setErrorState(adapterOffMessage, adapterOffStatus); | 304 mItemChooserDialog.setErrorState(adapterOffMessage, adapterOffStatus); |
305 } | 305 } |
306 | 306 |
307 @CalledByNative | 307 @CalledByNative |
308 private void notifyAdapterTurnedOn() { | 308 private void notifyAdapterTurnedOn() { |
309 mItemChooserDialog.clear(); | 309 mItemChooserDialog.clear(); |
310 if (mNativeBluetoothChooserDialogPtr != 0) { | |
311 nativeRestartSearch(mNativeBluetoothChooserDialogPtr); | |
312 } | |
313 } | 310 } |
314 | 311 |
315 @VisibleForTesting | 312 @VisibleForTesting |
316 @CalledByNative | 313 @CalledByNative |
317 void notifyDiscoveryState(int discoveryState) { | 314 void notifyDiscoveryState(int discoveryState) { |
318 switch (discoveryState) { | 315 switch (discoveryState) { |
319 case DISCOVERY_FAILED_TO_START: { | 316 case DISCOVERY_FAILED_TO_START: { |
320 // FAILED_TO_START might be caused by a missing Location permiss
ion. | 317 // FAILED_TO_START might be caused by a missing Location permiss
ion. |
321 // Check, and show a request if so. | 318 // Check, and show a request if so. |
322 checkLocationPermission(); | 319 checkLocationPermission(); |
(...skipping 16 matching lines...) Expand all Loading... |
339 @VisibleForTesting | 336 @VisibleForTesting |
340 native void nativeRestartSearch(long nativeBluetoothChooserAndroid); | 337 native void nativeRestartSearch(long nativeBluetoothChooserAndroid); |
341 // Help links. | 338 // Help links. |
342 @VisibleForTesting | 339 @VisibleForTesting |
343 native void nativeShowBluetoothOverviewLink(long nativeBluetoothChooserAndro
id); | 340 native void nativeShowBluetoothOverviewLink(long nativeBluetoothChooserAndro
id); |
344 @VisibleForTesting | 341 @VisibleForTesting |
345 native void nativeShowBluetoothAdapterOffLink(long nativeBluetoothChooserAnd
roid); | 342 native void nativeShowBluetoothAdapterOffLink(long nativeBluetoothChooserAnd
roid); |
346 @VisibleForTesting | 343 @VisibleForTesting |
347 native void nativeShowNeedLocationPermissionLink(long nativeBluetoothChooser
Android); | 344 native void nativeShowNeedLocationPermissionLink(long nativeBluetoothChooser
Android); |
348 } | 345 } |
OLD | NEW |