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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 if (ShouldHighlightNetwork(ethernet_network)) | 404 if (ShouldHighlightNetwork(ethernet_network)) |
405 flag |= FLAG_ASSOCIATED; | 405 flag |= FLAG_ASSOCIATED; |
406 const gfx::ImageSkia icon = ash::network_icon::GetImageForNetwork( | 406 const gfx::ImageSkia icon = ash::network_icon::GetImageForNetwork( |
407 ethernet_network, ash::network_icon::ICON_TYPE_LIST); | 407 ethernet_network, ash::network_icon::ICON_TYPE_LIST); |
408 menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, | 408 menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, |
409 label, icon, std::string(), flag)); | 409 label, icon, std::string(), flag)); |
410 } | 410 } |
411 | 411 |
412 // Get the list of all networks. | 412 // Get the list of all networks. |
413 NetworkStateHandler::NetworkStateList network_list; | 413 NetworkStateHandler::NetworkStateList network_list; |
414 handler->GetNetworkList(&network_list); | 414 handler->GetVisibleNetworkList(&network_list); |
415 | 415 |
416 // Cellular Networks | 416 // Cellular Networks |
417 if (handler->IsTechnologyEnabled(NetworkTypePattern::Cellular())) { | 417 if (handler->IsTechnologyEnabled(NetworkTypePattern::Cellular())) { |
418 // List Cellular networks. | 418 // List Cellular networks. |
419 for (NetworkStateHandler::NetworkStateList::const_iterator iter = | 419 for (NetworkStateHandler::NetworkStateList::const_iterator iter = |
420 network_list.begin(); iter != network_list.end(); ++iter) { | 420 network_list.begin(); iter != network_list.end(); ++iter) { |
421 const NetworkState* network = *iter; | 421 const NetworkState* network = *iter; |
422 if (network->type() != shill::kTypeCellular) | 422 if (network->type() != shill::kTypeCellular) |
423 continue; | 423 continue; |
424 std::string activation_state = network->activation_state(); | 424 std::string activation_state = network->activation_state(); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 return main_menu_model_.get(); | 672 return main_menu_model_.get(); |
673 } | 673 } |
674 | 674 |
675 void NetworkMenu::UpdateMenu() { | 675 void NetworkMenu::UpdateMenu() { |
676 refreshing_menu_ = true; | 676 refreshing_menu_ = true; |
677 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); | 677 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); |
678 refreshing_menu_ = false; | 678 refreshing_menu_ = false; |
679 } | 679 } |
680 | 680 |
681 } // namespace chromeos | 681 } // namespace chromeos |
OLD | NEW |