Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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. | |
| 4 | |
| 5 #ifndef CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ | |
| 6 #define CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "chrome/utility/utility_message_handler.h" | |
| 15 #include "chrome/utility/wifi/wifi_service.h" | |
| 16 | |
| 17 namespace base { | |
| 18 class DictionaryValue; | |
| 19 class Thread; | |
| 20 } | |
| 21 | |
| 22 namespace chrome { | |
| 23 | |
| 24 // Dispatches IPCs for out of process profile import. | |
|
Jorge Lucangeli Obes
2013/09/11 17:30:02
Outdated comment.
mef
2013/09/11 20:55:08
Done.
| |
| 25 class NetworkingPrivateHandler : public UtilityMessageHandler { | |
| 26 public: | |
| 27 NetworkingPrivateHandler(); | |
| 28 virtual ~NetworkingPrivateHandler(); | |
| 29 | |
| 30 // IPC::Listener: | |
| 31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 32 | |
| 33 static bool Send(IPC::Message* message); | |
| 34 | |
| 35 private: | |
| 36 void OnUseWiFiServiceMock(const base::DictionaryValue& parameters); | |
| 37 | |
| 38 void OnGetPropertiesStart(const std::string& network_guid); | |
| 39 void OnGetPropertiesSucceeded( | |
| 40 const std::string& network_guid, | |
| 41 const WiFiService::NetworkProperties& properties); | |
| 42 void OnGetPropertiesFailed(const std::string& error_name, | |
| 43 scoped_ptr<base::DictionaryValue> error_data); | |
| 44 | |
| 45 void OnSetPropertiesStart(const std::string& network_guid, | |
| 46 const base::DictionaryValue& properties); | |
| 47 void OnSetPropertiesSucceeded(const std::string& network_guid); | |
| 48 void OnSetPropertiesFailed(const std::string& error_name, | |
| 49 scoped_ptr<base::DictionaryValue> error_data); | |
| 50 | |
| 51 void OnStartConnectStart(const std::string& network_guid); | |
| 52 void OnStartConnectNetworkScanSucceeded( | |
| 53 const std::string& network_guid, | |
| 54 const WiFiService::NetworkList& network_list); | |
| 55 void OnStartConnectSucceeded(const std::string& network_guid); | |
| 56 void OnStartConnectFailed(const std::string& error_name, | |
| 57 scoped_ptr<base::DictionaryValue> error_data); | |
| 58 | |
| 59 void OnStartDisconnectStart(const std::string& network_guid); | |
| 60 void OnStartDisconnectSucceeded(const std::string& network_guid); | |
| 61 void OnStartDisconnectFailed(const std::string& error_name, | |
| 62 scoped_ptr<base::DictionaryValue> error_data); | |
| 63 | |
| 64 void OnRequestNetworkScan(); | |
| 65 void OnNetworkScanSucceeded(const WiFiService::NetworkList& network_list); | |
| 66 void OnNetworkScanFailed(const std::string& error_name, | |
| 67 scoped_ptr<base::DictionaryValue> error_data); | |
| 68 | |
| 69 void OnGetVisibleNetworks(); | |
| 70 void OnGetVisibleNetworksSucceeded( | |
| 71 const WiFiService::NetworkList& network_list); | |
| 72 void OnGetVisibleNetworksFailed(const std::string& error_name, | |
| 73 scoped_ptr<base::DictionaryValue> error_data); | |
| 74 | |
| 75 void OnNetworkListChangedEvent( | |
| 76 const WiFiService::NetworkGuidList& network_guid_list); | |
| 77 | |
| 78 void OnNetworksChangedEvent( | |
| 79 const WiFiService::NetworkGuidList& network_guid_list); | |
| 80 | |
| 81 | |
| 82 // Private Helper methods. | |
| 83 void WaitForNetworkState(const std::string& network_guid, | |
| 84 WiFiService::ConnectionState expected_state, | |
| 85 int attempt); | |
| 86 void CheckNetworkState(WiFiService::ConnectionState expected_state, | |
| 87 int attempt, | |
| 88 const std::string& network_guid, | |
| 89 const WiFiService::NetworkProperties& properties); | |
| 90 | |
| 91 // Platform-specific WiFi service. | |
| 92 scoped_ptr<WiFiService> wifi_service_; | |
| 93 }; | |
| 94 | |
| 95 } // namespace chrome | |
| 96 | |
| 97 #endif // CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ | |
| OLD | NEW |