Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM
[chromium-blink-merge.git] / chrome / browser / local_discovery / wifi / bootstrapping_network_switcher.h
blobca660b074a1af4671d055406787ecf4b37bd14fa
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_BOOTSTRAPPING_NETWORK_SWITCHER_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_BOOTSTRAPPING_NETWORK_SWITCHER_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/local_discovery/wifi/wifi_manager.h"
14 namespace local_discovery {
16 namespace wifi {
18 class BootstrappingNetworkSwitcher {
19 public:
20 typedef base::Callback<void(bool success)> SuccessCallback;
22 BootstrappingNetworkSwitcher(WifiManager* wifi_manager,
23 const std::string& connect_ssid,
24 const SuccessCallback& callback);
25 ~BootstrappingNetworkSwitcher();
27 void Connect();
29 void Disconnect();
31 private:
32 void OnGotNetworkList(const NetworkPropertiesList& networks);
34 void OnConnectStatus(bool status);
36 WifiManager* wifi_manager_;
37 std::string connect_ssid_;
38 SuccessCallback callback_;
40 std::string return_guid_;
41 bool connected_;
43 base::WeakPtrFactory<BootstrappingNetworkSwitcher> weak_factory_;
46 } // namespace wifi
48 } // namespace local_discovery
50 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_BOOTSTRAPPING_NETWORK_SWITCHER_H_