OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ | 5 #ifndef CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ |
6 #define CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ | 6 #define CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 private: | 37 private: |
38 // IPC Message Handlers. | 38 // IPC Message Handlers. |
39 | 39 |
40 // Use WiFiServiceMock with |parameters| for unit testing. | 40 // Use WiFiServiceMock with |parameters| for unit testing. |
41 void OnUseWiFiServiceMockForTest(const base::DictionaryValue& parameters); | 41 void OnUseWiFiServiceMockForTest(const base::DictionaryValue& parameters); |
42 | 42 |
43 // Common callback from WiFiService when error with |error_name| occurs. | 43 // Common callback from WiFiService when error with |error_name| occurs. |
44 // Sends |NetworkingPrivateMsg_API_Error| back to browser process. | 44 // Sends |NetworkingPrivateMsg_API_Error| back to browser process. |
45 // |message_id| is used to by NetworkingPrivateProcessClient to find matching | 45 // |message_id| is used to by NetworkingPrivateProcessClient to find matching |
46 // request. | 46 // request. |
47 void OnApiError(int message_id, | 47 void WiFiApiError(int message_id, |
48 const std::string& error_name, | 48 const std::string& error_name, |
49 scoped_ptr<base::DictionaryValue> error_data); | 49 scoped_ptr<base::DictionaryValue> error_data); |
50 | 50 |
51 // Get properties of network identified by |network_guid|. | 51 // Get properties of network identified by |network_guid|. |
52 void OnGetPropertiesStart(int message_id, const std::string& network_guid); | 52 void OnGetPropertiesStart(int message_id, const std::string& network_guid); |
53 | 53 |
54 // Callback from |WiFiService| to send |properties| back to browser process. | 54 // Callback from |WiFiService| to send |properties| back to browser process. |
55 void OnGetPropertiesSucceeded( | 55 void WiFiGetPropertiesSucceeded( |
56 int message_id, | 56 int message_id, |
57 const std::string& network_guid, | 57 const std::string& network_guid, |
58 const WiFiService::NetworkProperties& properties); | 58 const WiFiService::NetworkProperties& properties); |
59 | 59 |
60 // Set properties of network identified by |network_guid|. | 60 // Set properties of network identified by |network_guid|. |
61 void OnSetPropertiesStart(int message_id, | 61 void OnSetPropertiesStart(int message_id, |
62 const std::string& network_guid, | 62 const std::string& network_guid, |
63 const base::DictionaryValue& properties); | 63 const base::DictionaryValue& properties); |
64 | 64 |
65 // Callback from |WiFiService| to report set properties success back to | 65 // Callback from |WiFiService| to report set properties success back to |
66 // browser process. | 66 // browser process. |
67 void OnSetPropertiesSucceeded(int message_id, | 67 void WiFiSetPropertiesSucceeded(int message_id, |
68 const std::string& network_guid); | 68 const std::string& network_guid); |
69 | 69 |
70 // Start connect to network identified by |network_guid|. Does not wait for | 70 // Start connect to network identified by |network_guid|. Does not wait for |
71 // connect to succeed. If another network is connected, it will be remembered | 71 // connect to succeed. If another network is connected, it will be remembered |
72 // and disconnected prior to connect. | 72 // and disconnected prior to connect. |
73 void OnStartConnectStart(int message_id, const std::string& network_guid); | 73 void OnStartConnectStart(int message_id, const std::string& network_guid); |
74 | 74 |
75 // Callback from |WiFiService| to report start connect success back to | 75 // Callback from |WiFiService| to report start connect success back to |
76 // browser process. Does not wait for connect to actually succeed. If/When | 76 // browser process. Does not wait for connect to actually succeed. If/When |
77 // connect succeeds the |NetworksChanged| event will be generated. | 77 // connect succeeds the |NetworksChanged| event will be generated. |
78 void OnStartConnectSucceeded(int message_id, const std::string& network_guid); | 78 void WiFiStartConnectSucceeded(int message_id, |
| 79 const std::string& network_guid); |
79 | 80 |
80 // Start disconnect from network identified by |network_guid|. Does not wait | 81 // Start disconnect from network identified by |network_guid|. Does not wait |
81 // for disconnect to succeed. | 82 // for disconnect to succeed. |
82 void OnStartDisconnectStart(int message_id, const std::string& network_guid); | 83 void OnStartDisconnectStart(int message_id, const std::string& network_guid); |
83 | 84 |
84 // Callback from |WiFiService| to report start disconnect success back to | 85 // Callback from |WiFiService| to report start disconnect success back to |
85 // browser process. Does not wait for disconnect to actually succeed. If/When | 86 // browser process. Does not wait for disconnect to actually succeed. If/When |
86 // disconnect succeeds the |NetworksChanged| event will be generated. | 87 // disconnect succeeds the |NetworksChanged| event will be generated. |
87 void OnStartDisconnectSucceeded(int message_id, | 88 void WiFiStartDisconnectSucceeded(int message_id, |
88 const std::string& network_guid); | 89 const std::string& network_guid); |
89 | 90 |
90 // Request network scan. Does not wait for scan to complete. | 91 // Request network scan. Does not wait for scan to complete. |
91 void OnRequestNetworkScan(); | 92 void OnRequestNetworkScan(); |
92 | 93 |
93 // Callback from |WiFiService| to report that network scan has succeded. | 94 // Callback from |WiFiService| to report that network scan has succeded. |
94 // Generates |NetworkListChanged| event based on current |network_list|. | 95 // Generates |NetworkListChanged| event based on current |network_list|. |
95 void OnNetworkScanSucceeded(const WiFiService::NetworkList& network_list); | 96 void WiFiNetworkScanSucceeded(const WiFiService::NetworkList& network_list); |
96 | 97 |
97 // Get current list of visible networks. | 98 // Get current list of visible networks. |
98 void OnGetVisibleNetworks(int message_id); | 99 void OnGetVisibleNetworks(int message_id); |
99 | 100 |
100 // Callback from |WiFiService| to report list of visible networks. | 101 // Callback from |WiFiService| to report list of visible networks. |
101 void OnGetVisibleNetworksSucceeded( | 102 void WiFiGetVisibleNetworksSucceeded( |
102 int message_id, | 103 int message_id, |
103 const WiFiService::NetworkList& network_list); | 104 const WiFiService::NetworkList& network_list); |
104 | 105 |
105 // Send |NetworkListChanged| event with |network_guid_list|. | 106 // Send |NetworkListChanged| event with |network_guid_list|. |
106 void OnNetworkListChangedEvent( | 107 void WiFiNetworkListChangedEvent( |
107 const WiFiService::NetworkGuidList& network_guid_list); | 108 const WiFiService::NetworkGuidList& network_guid_list); |
108 | 109 |
109 // Send |NetworksChanged| event with |network_guid_list|. | 110 // Send |NetworksChanged| event with |network_guid_list|. |
110 void OnNetworksChangedEvent( | 111 void WiFiNetworksChangedEvent( |
111 const WiFiService::NetworkGuidList& network_guid_list); | 112 const WiFiService::NetworkGuidList& network_guid_list); |
112 | 113 |
113 // Platform-specific WiFi service. | 114 // Platform-specific WiFi service. |
114 scoped_ptr<wifi::WiFiService> wifi_service_; | 115 scoped_ptr<wifi::WiFiService> wifi_service_; |
115 | 116 |
116 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateHandler); | 117 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateHandler); |
117 }; | 118 }; |
118 | 119 |
119 } // namespace chrome | 120 } // namespace chrome |
120 | 121 |
121 #endif // CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ | 122 #endif // CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_ |
OLD | NEW |