Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1187)

Unified Diff: ash/system/chromeos/network/network_state_list_detailed_view.cc

Issue 189173004: Elim --ash-debug-show-preferred-networks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/chromeos/network/network_state_list_detailed_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/network_state_list_detailed_view.cc
diff --git a/ash/system/chromeos/network/network_state_list_detailed_view.cc b/ash/system/chromeos/network/network_state_list_detailed_view.cc
index 34d327299687d8de41ab5738b41d016bf10faa83..a6bb3aa316097c957211d9dda4758291dd1003fa 100644
--- a/ash/system/chromeos/network/network_state_list_detailed_view.cc
+++ b/ash/system/chromeos/network/network_state_list_detailed_view.cc
@@ -28,7 +28,6 @@
#include "base/time/time.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/network/device_state.h"
-#include "chromeos/network/favorite_state.h"
#include "chromeos/network/network_configuration_handler.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
@@ -46,7 +45,6 @@
#include "ui/views/widget/widget.h"
using chromeos::DeviceState;
-using chromeos::FavoriteState;
using chromeos::NetworkHandler;
using chromeos::NetworkState;
using chromeos::NetworkStateHandler;
@@ -163,7 +161,6 @@ NetworkStateListDetailedView::NetworkStateListDetailedView(
turn_on_wifi_(NULL),
other_mobile_(NULL),
other_vpn_(NULL),
- toggle_debug_preferred_networks_(NULL),
settings_(NULL),
proxy_settings_(NULL),
scanning_view_(NULL),
@@ -187,15 +184,9 @@ void NetworkStateListDetailedView::ManagerChanged() {
void NetworkStateListDetailedView::NetworkListChanged() {
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
- if (list_type_ == LIST_TYPE_DEBUG_PREFERRED) {
- NetworkStateHandler::FavoriteStateList favorite_list;
- handler->GetFavoriteList(&favorite_list);
- UpdatePreferred(favorite_list);
- } else {
- NetworkStateHandler::NetworkStateList network_list;
- handler->GetNetworkList(&network_list);
- UpdateNetworks(network_list);
- }
+ NetworkStateHandler::NetworkStateList network_list;
+ handler->GetNetworkList(&network_list);
+ UpdateNetworks(network_list);
UpdateNetworkList();
UpdateHeaderButtons();
UpdateNetworkExtra();
@@ -226,7 +217,6 @@ void NetworkStateListDetailedView::Init() {
turn_on_wifi_ = NULL;
other_mobile_ = NULL;
other_vpn_ = NULL;
- toggle_debug_preferred_networks_ = NULL;
settings_ = NULL;
proxy_settings_ = NULL;
scanning_view_ = NULL;
@@ -285,13 +275,6 @@ void NetworkStateListDetailedView::ButtonPressed(views::Button* sender,
delegate->ChangeProxySettings();
} else if (sender == other_mobile_) {
delegate->ShowOtherNetworkDialog(shill::kTypeCellular);
- } else if (sender == toggle_debug_preferred_networks_) {
- list_type_ = (list_type_ == LIST_TYPE_NETWORK)
- ? LIST_TYPE_DEBUG_PREFERRED : LIST_TYPE_NETWORK;
- // Re-initialize this after processing the event.
- base::MessageLoopForUI::current()->PostTask(
- FROM_HERE,
- base::Bind(&NetworkStateListDetailedView::Init, AsWeakPtr()));
} else if (sender == other_wifi_) {
Shell::GetInstance()->metrics()->RecordUserMetricsAction(
ash::UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED);
@@ -323,14 +306,6 @@ void NetworkStateListDetailedView::OnViewClicked(views::View* sender) {
return;
const std::string& service_path = found->second;
- if (list_type_ == LIST_TYPE_DEBUG_PREFERRED) {
- NetworkHandler::Get()->network_configuration_handler()->
- RemoveConfiguration(service_path,
- base::Bind(&base::DoNothing),
- chromeos::network_handler::ErrorCallback());
- return;
- }
-
const NetworkState* network = NetworkHandler::Get()->network_state_handler()->
GetNetworkState(service_path);
if (!network || network->IsConnectedState() || network->IsConnectingState()) {
@@ -423,16 +398,6 @@ void NetworkStateListDetailedView::CreateNetworkExtra() {
other_mobile_ = new TrayPopupLabelButton(
this, rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_OTHER_MOBILE));
bottom_row->AddChildView(other_mobile_);
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kAshDebugShowPreferredNetworks)) {
- // Debugging UI to view and remove favorites from the status area.
- std::string toggle_debug_preferred_label =
- (list_type_ == LIST_TYPE_DEBUG_PREFERRED) ? "Visible" : "Preferred";
- toggle_debug_preferred_networks_ = new TrayPopupLabelButton(
- this, base::UTF8ToUTF16(toggle_debug_preferred_label));
- bottom_row->AddChildView(toggle_debug_preferred_networks_);
- }
} else {
other_vpn_ = new TrayPopupLabelButton(
this,
@@ -491,7 +456,6 @@ void NetworkStateListDetailedView::UpdateTechnologyButton(
void NetworkStateListDetailedView::UpdateNetworks(
const NetworkStateHandler::NetworkStateList& networks) {
- DCHECK(list_type_ != LIST_TYPE_DEBUG_PREFERRED);
network_list_.clear();
for (NetworkStateHandler::NetworkStateList::const_iterator iter =
networks.begin(); iter != networks.end(); ++iter) {
@@ -506,18 +470,6 @@ void NetworkStateListDetailedView::UpdateNetworks(
}
}
-void NetworkStateListDetailedView::UpdatePreferred(
- const NetworkStateHandler::FavoriteStateList& favorites) {
- DCHECK(list_type_ == LIST_TYPE_DEBUG_PREFERRED);
- network_list_.clear();
- for (NetworkStateHandler::FavoriteStateList::const_iterator iter =
- favorites.begin(); iter != favorites.end(); ++iter) {
- const FavoriteState* favorite = *iter;
- NetworkInfo* info = new NetworkInfo(favorite->path());
- network_list_.push_back(info);
- }
-}
-
void NetworkStateListDetailedView::UpdateNetworkList() {
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
@@ -527,29 +479,18 @@ void NetworkStateListDetailedView::UpdateNetworkList() {
NetworkInfo* info = network_list_[i];
const NetworkState* network =
handler->GetNetworkState(info->service_path);
- if (network) {
- info->image = network_icon::GetImageForNetwork(
- network, network_icon::ICON_TYPE_LIST);
- info->label = network_icon::GetLabelForNetwork(
- network, network_icon::ICON_TYPE_LIST);
- info->highlight =
- network->IsConnectedState() || network->IsConnectingState();
- info->disable =
- network->activation_state() == shill::kActivationStateActivating;
- if (!animating && network->IsConnectingState())
- animating = true;
- } else if (list_type_ == LIST_TYPE_DEBUG_PREFERRED) {
- // Favorites that are visible will use the same display info as the
- // visible network. Non visible favorites will show the disconnected
- // icon and the name of the network.
- const FavoriteState* favorite =
- handler->GetFavoriteState(info->service_path);
- if (favorite) {
- info->image = network_icon::GetImageForDisconnectedNetwork(
- network_icon::ICON_TYPE_LIST, favorite->type());
- info->label = base::UTF8ToUTF16(favorite->name());
- }
- }
+ if (!network)
+ continue;
+ info->image = network_icon::GetImageForNetwork(
+ network, network_icon::ICON_TYPE_LIST);
+ info->label = network_icon::GetLabelForNetwork(
+ network, network_icon::ICON_TYPE_LIST);
+ info->highlight =
+ network->IsConnectedState() || network->IsConnectingState();
+ info->disable =
+ network->activation_state() == shill::kActivationStateActivating;
+ if (!animating && network->IsConnectingState())
+ animating = true;
}
if (animating)
network_icon::NetworkIconAnimation::GetInstance()->AddObserver(this);
« no previous file with comments | « ash/system/chromeos/network/network_state_list_detailed_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698