OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/status/network_menu.h" | 5 #include "chrome/browser/chromeos/status/network_menu.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } else if (flags & FLAG_CELLULAR) { | 231 } else if (flags & FLAG_CELLULAR) { |
232 CellularNetwork* cellular = cros->FindCellularNetworkByPath( | 232 CellularNetwork* cellular = cros->FindCellularNetworkByPath( |
233 menu_items_[index].wireless_path); | 233 menu_items_[index].wireless_path); |
234 if (cellular) { | 234 if (cellular) { |
235 // TODO(zelidrag): Start activation process if needed. | 235 // TODO(zelidrag): Start activation process if needed. |
236 // Connect or reconnect. | 236 // Connect or reconnect. |
237 cros->ConnectToCellularNetwork(cellular); | 237 cros->ConnectToCellularNetwork(cellular); |
238 } | 238 } |
239 } else if (flags & FLAG_OTHER_NETWORK) { | 239 } else if (flags & FLAG_OTHER_NETWORK) { |
240 bool favorite = remember == 0 ? false : true; // default is true | 240 bool favorite = remember == 0 ? false : true; // default is true |
241 cros->ConnectToWifiNetwork(ssid, passphrase, std::string(), std::string(), | 241 cros->ConnectToWifiNetwork( |
242 favorite); | 242 passphrase.empty() ? SECURITY_NONE : SECURITY_UNKNOWN, |
| 243 ssid, passphrase, std::string(), std::string(), favorite); |
243 } | 244 } |
244 return true; | 245 return true; |
245 } | 246 } |
246 | 247 |
247 //////////////////////////////////////////////////////////////////////////////// | 248 //////////////////////////////////////////////////////////////////////////////// |
248 // NetworkMenu, menus::MenuModel implementation: | 249 // NetworkMenu, menus::MenuModel implementation: |
249 | 250 |
250 int NetworkMenu::GetItemCount() const { | 251 int NetworkMenu::GetItemCount() const { |
251 return static_cast<int>(menu_items_.size()); | 252 return static_cast<int>(menu_items_.size()); |
252 } | 253 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 chromeos::TYPE_WIFI); | 685 chromeos::TYPE_WIFI); |
685 browser->ShowOptionsTab(page); | 686 browser->ShowOptionsTab(page); |
686 } | 687 } |
687 } else { | 688 } else { |
688 const bool kFocusLogin = true; | 689 const bool kFocusLogin = true; |
689 ShowNetworkConfigView(new NetworkConfigView(), kFocusLogin); | 690 ShowNetworkConfigView(new NetworkConfigView(), kFocusLogin); |
690 } | 691 } |
691 } | 692 } |
692 | 693 |
693 } // namespace chromeos | 694 } // namespace chromeos |
OLD | NEW |