OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // This gets called on initialization, so any changes should be reflected | 476 // This gets called on initialization, so any changes should be reflected |
477 // in CrosMock::SetNetworkLibraryStatusAreaExpectations(). | 477 // in CrosMock::SetNetworkLibraryStatusAreaExpectations(). |
478 | 478 |
479 menu_items_.clear(); | 479 menu_items_.clear(); |
480 // Populate our MenuItems with the current list of wifi networks. | 480 // Populate our MenuItems with the current list of wifi networks. |
481 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); | 481 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); |
482 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 482 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
483 | 483 |
484 string16 label; | 484 string16 label; |
485 | 485 |
| 486 if (cros->IsLocked()) { |
| 487 label = l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_LOCKED); |
| 488 menu_items_.push_back( |
| 489 MenuItem(ui::MenuModel::TYPE_COMMAND, |
| 490 label, SkBitmap(), |
| 491 std::string(), FLAG_DISABLED)); |
| 492 return; |
| 493 } |
| 494 |
486 // Ethernet | 495 // Ethernet |
487 bool ethernet_available = cros->ethernet_available(); | 496 bool ethernet_available = cros->ethernet_available(); |
488 bool ethernet_enabled = cros->ethernet_enabled(); | 497 bool ethernet_enabled = cros->ethernet_enabled(); |
489 if (ethernet_available && ethernet_enabled) { | 498 if (ethernet_available && ethernet_enabled) { |
490 bool ethernet_connected = cros->ethernet_connected(); | 499 bool ethernet_connected = cros->ethernet_connected(); |
491 bool ethernet_connecting = cros->ethernet_connecting(); | 500 bool ethernet_connecting = cros->ethernet_connecting(); |
492 | 501 |
493 if (ethernet_connecting) { | 502 if (ethernet_connecting) { |
494 label = l10n_util::GetStringFUTF16( | 503 label = l10n_util::GetStringFUTF16( |
495 IDS_STATUSBAR_NETWORK_DEVICE_STATUS, | 504 IDS_STATUSBAR_NETWORK_DEVICE_STATUS, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 chrome::kInternetOptionsSubPage, | 758 chrome::kInternetOptionsSubPage, |
750 chromeos::TYPE_WIFI); | 759 chromeos::TYPE_WIFI); |
751 browser->ShowOptionsTab(page); | 760 browser->ShowOptionsTab(page); |
752 } | 761 } |
753 } else { | 762 } else { |
754 ShowNetworkConfigView(new NetworkConfigView()); | 763 ShowNetworkConfigView(new NetworkConfigView()); |
755 } | 764 } |
756 } | 765 } |
757 | 766 |
758 } // namespace chromeos | 767 } // namespace chromeos |
OLD | NEW |