| Index: chrome/browser/local_discovery/wifi/bootstrapping_device_lister.h
|
| diff --git a/chrome/browser/local_discovery/wifi/bootstrapping_device_lister.h b/chrome/browser/local_discovery/wifi/bootstrapping_device_lister.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..03af401de8cebed6379ba0ad1705277a8f27a395
|
| --- /dev/null
|
| +++ b/chrome/browser/local_discovery/wifi/bootstrapping_device_lister.h
|
| @@ -0,0 +1,68 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_BOOTSTRAPPING_DEVICE_LISTER_H_
|
| +#define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_BOOTSTRAPPING_DEVICE_LISTER_H_
|
| +
|
| +#include <map>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "chrome/browser/local_discovery/wifi/wifi_manager.h"
|
| +
|
| +namespace local_discovery {
|
| +
|
| +namespace wifi {
|
| +
|
| +struct BootstrappingDeviceDescription {
|
| + enum ConnectionStatus {
|
| + ONLINE,
|
| + OFFLINE,
|
| + CONNECTING,
|
| + NOT_CONFIGURED,
|
| + LOCAL_ONLY
|
| + };
|
| +
|
| + BootstrappingDeviceDescription();
|
| + ~BootstrappingDeviceDescription();
|
| +
|
| + std::string device_network_id;
|
| + std::string device_ssid;
|
| + std::string device_name;
|
| + std::string device_kind;
|
| + ConnectionStatus connection_status;
|
| +};
|
| +
|
| +class BootstrappingDeviceLister {
|
| + public:
|
| + typedef base::Callback<
|
| + void(bool available, const BootstrappingDeviceDescription& description)>
|
| + UpdateCallback;
|
| +
|
| + BootstrappingDeviceLister(WifiManager* wifi_manager,
|
| + const UpdateCallback& update_callback);
|
| + ~BootstrappingDeviceLister();
|
| +
|
| + void Start();
|
| +
|
| + private:
|
| + typedef std::map<std::string /*ssid*/, std::string /*internal_name*/>
|
| + ActiveDeviceMap;
|
| +
|
| + void OnGotSSIDList(const std::vector<NetworkProperties>& ssids);
|
| +
|
| + WifiManager* wifi_manager_;
|
| + UpdateCallback update_callback_;
|
| +
|
| + bool started_;
|
| + ActiveDeviceMap active_devices_;
|
| + scoped_ptr<NetworkListWatcher> network_watcher_;
|
| + base::WeakPtrFactory<BootstrappingDeviceLister> weak_factory_;
|
| +};
|
| +
|
| +} // namespace wifi
|
| +
|
| +} // namespace local_discovery
|
| +
|
| +#endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_BOOTSTRAPPING_DEVICE_LISTER_H_
|
|
|