| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 if (!ip_address.empty()) { | 857 if (!ip_address.empty()) { |
| 858 address_items.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, | 858 address_items.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, |
| 859 ASCIIToUTF16(cros->IPAddress()), gfx::ImageSkia(), std::string(), | 859 ASCIIToUTF16(cros->IPAddress()), gfx::ImageSkia(), std::string(), |
| 860 FLAG_DISABLED)); | 860 FLAG_DISABLED)); |
| 861 } | 861 } |
| 862 } | 862 } |
| 863 | 863 |
| 864 const NetworkDevice* ether = cros->FindEthernetDevice(); | 864 const NetworkDevice* ether = cros->FindEthernetDevice(); |
| 865 if (ether) { | 865 if (ether) { |
| 866 std::string hardware_address; | 866 std::string hardware_address; |
| 867 cros->GetIPConfigs(ether->device_path(), &hardware_address, | 867 cros->GetIPConfigsAndBlock(ether->device_path(), &hardware_address, |
| 868 NetworkLibrary::FORMAT_COLON_SEPARATED_HEX); | 868 NetworkLibrary::FORMAT_COLON_SEPARATED_HEX); |
| 869 if (!hardware_address.empty()) { | 869 if (!hardware_address.empty()) { |
| 870 std::string label = l10n_util::GetStringUTF8( | 870 std::string label = l10n_util::GetStringUTF8( |
| 871 IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET) + " " + hardware_address; | 871 IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET) + " " + hardware_address; |
| 872 address_items.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, | 872 address_items.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, |
| 873 UTF8ToUTF16(label), gfx::ImageSkia(), std::string(), FLAG_DISABLED)); | 873 UTF8ToUTF16(label), gfx::ImageSkia(), std::string(), FLAG_DISABLED)); |
| 874 } | 874 } |
| 875 } | 875 } |
| 876 | 876 |
| 877 if (cros->wifi_enabled()) { | 877 if (cros->wifi_enabled()) { |
| 878 const NetworkDevice* wifi = cros->FindWifiDevice(); | 878 const NetworkDevice* wifi = cros->FindWifiDevice(); |
| 879 if (wifi) { | 879 if (wifi) { |
| 880 std::string hardware_address; | 880 std::string hardware_address; |
| 881 cros->GetIPConfigs(wifi->device_path(), | 881 cros->GetIPConfigsAndBlock(wifi->device_path(), |
| 882 &hardware_address, NetworkLibrary::FORMAT_COLON_SEPARATED_HEX); | 882 &hardware_address, NetworkLibrary::FORMAT_COLON_SEPARATED_HEX); |
| 883 if (!hardware_address.empty()) { | 883 if (!hardware_address.empty()) { |
| 884 std::string label = l10n_util::GetStringUTF8( | 884 std::string label = l10n_util::GetStringUTF8( |
| 885 IDS_STATUSBAR_NETWORK_DEVICE_WIFI) + " " + hardware_address; | 885 IDS_STATUSBAR_NETWORK_DEVICE_WIFI) + " " + hardware_address; |
| 886 address_items.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, | 886 address_items.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, |
| 887 UTF8ToUTF16(label), gfx::ImageSkia(), std::string(), | 887 UTF8ToUTF16(label), gfx::ImageSkia(), std::string(), |
| 888 FLAG_DISABLED)); | 888 FLAG_DISABLED)); |
| 889 } | 889 } |
| 890 } | 890 } |
| 891 } | 891 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 | 1104 |
| 1105 void NetworkMenu::ShowOtherVPN() { | 1105 void NetworkMenu::ShowOtherVPN() { |
| 1106 NetworkConfigView::ShowForType(TYPE_VPN, delegate_->GetNativeWindow()); | 1106 NetworkConfigView::ShowForType(TYPE_VPN, delegate_->GetNativeWindow()); |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 void NetworkMenu::ShowOtherCellular() { | 1109 void NetworkMenu::ShowOtherCellular() { |
| 1110 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); | 1110 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 } // namespace chromeos | 1113 } // namespace chromeos |
| OLD | NEW |