Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 const gfx::ImageSkia icon = ash::network_icon::GetImageForNetwork( | 412 const gfx::ImageSkia icon = ash::network_icon::GetImageForNetwork( |
| 413 ethernet_network, ash::network_icon::ICON_TYPE_LIST); | 413 ethernet_network, ash::network_icon::ICON_TYPE_LIST); |
| 414 menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, | 414 menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, |
| 415 label, icon, std::string(), flag)); | 415 label, icon, std::string(), flag)); |
| 416 } | 416 } |
| 417 | 417 |
| 418 // Get the list of all networks. | 418 // Get the list of all networks. |
| 419 NetworkStateHandler::NetworkStateList network_list; | 419 NetworkStateHandler::NetworkStateList network_list; |
| 420 handler->GetVisibleNetworkList(&network_list); | 420 handler->GetVisibleNetworkList(&network_list); |
| 421 | 421 |
| 422 // Cellular Networks | 422 // Cellular Networks |
|
Kyle Horimoto
2017/06/05 17:43:30
stevenjb@: What about this section (down to line 4
| |
| 423 if (handler->IsTechnologyEnabled(NetworkTypePattern::Cellular())) { | 423 if (handler->IsTechnologyEnabled(NetworkTypePattern::Cellular())) { |
| 424 // List Cellular networks. | 424 // List Cellular networks. |
| 425 for (NetworkStateHandler::NetworkStateList::const_iterator iter = | 425 for (NetworkStateHandler::NetworkStateList::const_iterator iter = |
| 426 network_list.begin(); iter != network_list.end(); ++iter) { | 426 network_list.begin(); iter != network_list.end(); ++iter) { |
| 427 const NetworkState* network = *iter; | 427 const NetworkState* network = *iter; |
| 428 if (network->type() != shill::kTypeCellular) | 428 if (network->type() != shill::kTypeCellular) |
| 429 continue; | 429 continue; |
| 430 std::string activation_state = network->activation_state(); | 430 std::string activation_state = network->activation_state(); |
| 431 | 431 |
| 432 // This is only used in the login screen; do not show unactivated | 432 // This is only used in the login screen; do not show unactivated |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 const gfx::ImageSkia icon = | 464 const gfx::ImageSkia icon = |
| 465 ash::network_icon::GetImageForDisconnectedCellNetwork(); | 465 ash::network_icon::GetImageForDisconnectedCellNetwork(); |
| 466 menu_items_.push_back(MenuItem( | 466 menu_items_.push_back(MenuItem( |
| 467 ui::MenuModel::TYPE_COMMAND, | 467 ui::MenuModel::TYPE_COMMAND, |
| 468 l10n_util::GetStringUTF16( | 468 l10n_util::GetStringUTF16( |
| 469 IDS_OPTIONS_SETTINGS_OTHER_CELLULAR_NETWORKS), | 469 IDS_OPTIONS_SETTINGS_OTHER_CELLULAR_NETWORKS), |
| 470 icon, std::string(), FLAG_ADD_CELLULAR)); | 470 icon, std::string(), FLAG_ADD_CELLULAR)); |
| 471 } | 471 } |
| 472 } else { | 472 } else { |
| 473 int initializing_message_id = | 473 int initializing_message_id = |
| 474 ash::network_icon::GetCellularUninitializedMsg(); | 474 ash::network_icon::GetMobileUninitializedMsg(); |
| 475 if (initializing_message_id) { | 475 if (initializing_message_id) { |
| 476 // Initializing cellular modem... | 476 // Initializing cellular modem... |
| 477 AddMessageItem(l10n_util::GetStringUTF16(initializing_message_id)); | 477 AddMessageItem(l10n_util::GetStringUTF16(initializing_message_id)); |
| 478 } | 478 } |
| 479 } | 479 } |
| 480 | 480 |
| 481 // Wimax Networks | 481 // Wimax Networks |
| 482 if (handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())) { | 482 if (handler->IsTechnologyEnabled(NetworkTypePattern::Wimax())) { |
| 483 // List Wimax networks. | 483 // List Wimax networks. |
| 484 for (NetworkStateHandler::NetworkStateList::const_iterator iter = | 484 for (NetworkStateHandler::NetworkStateList::const_iterator iter = |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 return main_menu_model_.get(); | 676 return main_menu_model_.get(); |
| 677 } | 677 } |
| 678 | 678 |
| 679 void NetworkMenu::UpdateMenu() { | 679 void NetworkMenu::UpdateMenu() { |
| 680 refreshing_menu_ = true; | 680 refreshing_menu_ = true; |
| 681 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); | 681 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); |
| 682 refreshing_menu_ = false; | 682 refreshing_menu_ = false; |
| 683 } | 683 } |
| 684 | 684 |
| 685 } // namespace chromeos | 685 } // namespace chromeos |
| OLD | NEW |