OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if (!ParseCommandLine(argc, argv)) { | 66 if (!ParseCommandLine(argc, argv)) { |
67 VLOG(0) << "Usage: " << argv[0] << | 67 VLOG(0) << "Usage: " << argv[0] << |
68 " [--list]" | 68 " [--list]" |
69 " [--get_properties]" | 69 " [--get_properties]" |
70 " [--create]" | 70 " [--create]" |
71 " [--connect]" | 71 " [--connect]" |
72 " [--disconnect]" | 72 " [--disconnect]" |
73 " [--network_guid=<network_guid>]" | 73 " [--network_guid=<network_guid>]" |
74 " [--frequency=0|2400|5000]" | 74 " [--frequency=0|2400|5000]" |
75 " [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]" | 75 " [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]" |
76 " [--password=<wifi password>]" | 76 " [--password=<wifi_password>]" |
77 " [<network_guid>]\n"; | 77 " [<network_guid>]\n"; |
78 return RESULT_WRONG_USAGE; | 78 return RESULT_WRONG_USAGE; |
79 } | 79 } |
80 | 80 |
81 base::MessageLoopForIO loop; | 81 base::MessageLoopForIO loop; |
82 result_ = RESULT_PENDING; | 82 result_ = RESULT_PENDING; |
83 | 83 |
84 return result_; | 84 return result_; |
85 } | 85 } |
86 | 86 |
(...skipping 15 matching lines...) Expand all Loading... |
102 #else | 102 #else |
103 network_guid = parsed_command_line.GetArgs()[0]; | 103 network_guid = parsed_command_line.GetArgs()[0]; |
104 #endif | 104 #endif |
105 } | 105 } |
106 | 106 |
107 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
108 if (parsed_command_line.HasSwitch("debug")) | 108 if (parsed_command_line.HasSwitch("debug")) |
109 MessageBoxA(NULL, __FUNCTION__, "Debug Me!", MB_OK); | 109 MessageBoxA(NULL, __FUNCTION__, "Debug Me!", MB_OK); |
110 #endif | 110 #endif |
111 | 111 |
112 #if defined(OS_WIN) | 112 #if defined(OS_WIN) || defined(OS_MACOSX) |
113 scoped_ptr<WiFiService> wifi_service(WiFiService::Create()); | 113 scoped_ptr<WiFiService> wifi_service(WiFiService::Create()); |
114 #else | 114 #else |
115 scoped_ptr<WiFiService> wifi_service(WiFiService::CreateForTest()); | 115 scoped_ptr<WiFiService> wifi_service(WiFiService::CreateForTest()); |
116 #endif | 116 #endif |
117 | 117 |
118 wifi_service->Initialize(NULL); | 118 wifi_service->Initialize(NULL); |
119 | 119 |
120 if (parsed_command_line.HasSwitch("list")) { | 120 if (parsed_command_line.HasSwitch("list")) { |
121 base::ListValue network_list; | 121 base::ListValue network_list; |
122 wifi_service->GetVisibleNetworks(std::string(), &network_list); | 122 wifi_service->GetVisibleNetworks(std::string(), &network_list); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 int main(int argc, const char* argv[]) { | 198 int main(int argc, const char* argv[]) { |
199 CommandLine::Init(argc, argv); | 199 CommandLine::Init(argc, argv); |
200 logging::LoggingSettings settings; | 200 logging::LoggingSettings settings; |
201 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 201 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
202 logging::InitLogging(settings); | 202 logging::InitLogging(settings); |
203 | 203 |
204 wifi::WiFiTest wifi_test; | 204 wifi::WiFiTest wifi_test; |
205 return wifi_test.Main(argc, argv); | 205 return wifi_test.Main(argc, argv); |
206 } | 206 } |
OLD | NEW |