| 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 #ifndef CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |   5 #ifndef CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 
|   6 #define CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |   6 #define CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 
|   7  |   7  | 
|   8 #include <string> |   8 #include <string> | 
|   9  |   9  | 
|  10 #include "base/callback.h" |  10 #include "base/callback.h" | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
|  21     // Chromium can't ask for permission to scan for Bluetooth devices. |  21     // Chromium can't ask for permission to scan for Bluetooth devices. | 
|  22     DENIED_PERMISSION, |  22     DENIED_PERMISSION, | 
|  23     // The user cancelled the chooser instead of selecting a device. |  23     // The user cancelled the chooser instead of selecting a device. | 
|  24     CANCELLED, |  24     CANCELLED, | 
|  25     // The user selected device |opt_device_id|. |  25     // The user selected device |opt_device_id|. | 
|  26     SELECTED, |  26     SELECTED, | 
|  27     // The user asked for a new Bluetooth discovery session to start. |  27     // The user asked for a new Bluetooth discovery session to start. | 
|  28     RESCAN, |  28     RESCAN, | 
|  29     // Show overview page for Bluetooth. |  29     // Show overview page for Bluetooth. | 
|  30     SHOW_OVERVIEW_HELP, |  30     SHOW_OVERVIEW_HELP, | 
|  31     // Show help page explaining what Bluetooth pairing means. |  | 
|  32     SHOW_PAIRING_HELP, |  | 
|  33     // Show help page explaining why scanning failed because Bluetooth is off. |  31     // Show help page explaining why scanning failed because Bluetooth is off. | 
|  34     SHOW_ADAPTER_OFF_HELP, |  32     SHOW_ADAPTER_OFF_HELP, | 
|  35     // Show help page explaining why Chromium needs the Location permission to |  33     // Show help page explaining why Chromium needs the Location permission to | 
|  36     // scan for Bluetooth devices. Only used on Android. |  34     // scan for Bluetooth devices. Only used on Android. | 
|  37     SHOW_NEED_LOCATION_HELP, |  35     SHOW_NEED_LOCATION_HELP, | 
|  38  |  36  | 
|  39     // As the dialog implementations grow more user-visible buttons and knobs, |  37     // As the dialog implementations grow more user-visible buttons and knobs, | 
|  40     // we'll add enumerators here to support them. |  38     // we'll add enumerators here to support them. | 
|  41   }; |  39   }; | 
|  42  |  40  | 
|  43   // Chooser implementations are constructed with an |EventHandler| and report |  41   // Chooser implementations are constructed with an |EventHandler| and report | 
|  44   // user interaction with the chooser through it. |opt_device_id| is an empty |  42   // user interaction with the chooser through it. |opt_device_id| is an empty | 
|  45   // string except for Event::SELECTED. |  43   // string except for Event::SELECTED. | 
|  46   // |  44   // | 
|  47   // The EventHandler won't be called after the chooser object is destroyed. |  45   // The EventHandler won't be called after the chooser object is destroyed. | 
|  48   // |  46   // | 
|  49   // After the EventHandler is called with Event::CANCELLED or Event::SELECTED, |  47   // After the EventHandler is called with Event::CANCELLED, Event::SELECTED, | 
|  50   // it won't be called again, and users must not call any more BluetoothChooser |  48   // Event::DENIED_PERMISSION or Event::SHOW_*, it won't be called again, and | 
|  51   // methods. |  49   // users must not call any more BluetoothChooser methods. | 
|  52   typedef base::Callback<void(Event, const std::string& opt_device_id)> |  50   typedef base::Callback<void(Event, const std::string& opt_device_id)> | 
|  53       EventHandler; |  51       EventHandler; | 
|  54  |  52  | 
|  55   BluetoothChooser() {} |  53   BluetoothChooser() {} | 
|  56   virtual ~BluetoothChooser(); |  54   virtual ~BluetoothChooser(); | 
|  57  |  55  | 
|  58   // Some platforms (especially Android) require Chromium to have permission |  56   // Some platforms (especially Android) require Chromium to have permission | 
|  59   // from the user before it can scan for Bluetooth devices. This function |  57   // from the user before it can scan for Bluetooth devices. This function | 
|  60   // returns false if Chromium isn't even allowed to ask. It defaults to true. |  58   // returns false if Chromium isn't even allowed to ask. It defaults to true. | 
|  61   virtual bool CanAskForScanningPermission(); |  59   virtual bool CanAskForScanningPermission(); | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
|  75                          const base::string16& device_name) {} |  73                          const base::string16& device_name) {} | 
|  76  |  74  | 
|  77   // Tells the chooser that a device is no longer available. The chooser should |  75   // Tells the chooser that a device is no longer available. The chooser should | 
|  78   // not call DeviceSelected() for a device that's been removed. |  76   // not call DeviceSelected() for a device that's been removed. | 
|  79   virtual void RemoveDevice(const std::string& device_id) {} |  77   virtual void RemoveDevice(const std::string& device_id) {} | 
|  80 }; |  78 }; | 
|  81  |  79  | 
|  82 }  // namespace content |  80 }  // namespace content | 
|  83  |  81  | 
|  84 #endif  // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |  82 #endif  // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 
| OLD | NEW |