Index: ash/common/system/chromeos/network/network_state_list_detailed_view.cc |
diff --git a/ash/common/system/chromeos/network/network_state_list_detailed_view.cc b/ash/common/system/chromeos/network/network_state_list_detailed_view.cc |
index 142bb4ec51f0995caf46001c60b4f67f099f9812..de5ed042f4bde8cc8d4414af1057326f2650e784 100644 |
--- a/ash/common/system/chromeos/network/network_state_list_detailed_view.cc |
+++ b/ash/common/system/chromeos/network/network_state_list_detailed_view.cc |
@@ -9,7 +9,6 @@ |
#include "ash/common/ash_constants.h" |
#include "ash/common/ash_switches.h" |
-#include "ash/common/material_design/material_design_controller.h" |
#include "ash/common/shell_window_ids.h" |
#include "ash/common/system/chromeos/network/tray_network_state_observer.h" |
#include "ash/common/system/chromeos/network/vpn_list_view.h" |
@@ -357,7 +356,7 @@ |
CreateScrollableList(); |
CreateNetworkExtra(); |
- CreateTitleRow(IDS_ASH_STATUS_TRAY_NETWORK); |
+ CreateHeaderEntry(); |
network_list_view_->set_container(scroll_content()); |
Update(); |
@@ -371,11 +370,10 @@ |
return STATE_LIST_VIEW; |
} |
-void NetworkStateListDetailedView::HandleButtonPressed(views::Button* sender, |
- const ui::Event& event) { |
- if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
- return; |
- |
+// Views overrides |
+ |
+void NetworkStateListDetailedView::ButtonPressed(views::Button* sender, |
+ const ui::Event& event) { |
if (sender == info_icon_) { |
ToggleInfoBubble(); |
return; |
@@ -413,15 +411,20 @@ |
} |
} |
-void NetworkStateListDetailedView::HandleViewClicked(views::View* view) { |
+void NetworkStateListDetailedView::OnViewClicked(views::View* sender) { |
// If the info bubble was visible, close it when some other item is clicked. |
ResetInfoBubble(); |
+ if (sender == footer()->content()) { |
+ TransitionToDefaultView(); |
+ return; |
+ } |
+ |
if (login_ == LoginStatus::LOCKED) |
return; |
std::string service_path; |
- if (!network_list_view_->IsNetworkEntry(view, &service_path)) |
+ if (!network_list_view_->IsNetworkEntry(sender, &service_path)) |
return; |
const NetworkState* network = |
@@ -443,9 +446,10 @@ |
} |
} |
-void NetworkStateListDetailedView::CreateExtraTitleRowButtons() { |
- if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
- return; |
+// Create UI components. |
+ |
+void NetworkStateListDetailedView::CreateHeaderEntry() { |
+ CreateSpecialRow(IDS_ASH_STATUS_TRAY_NETWORK, this); |
if (list_type_ != LIST_TYPE_VPN) { |
NetworkStateHandler* network_state_handler = |
@@ -458,7 +462,7 @@ |
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISABLE_WIFI)); |
button_wifi_->SetToggledTooltipText( |
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ENABLE_WIFI)); |
- title_row()->AddButton(button_wifi_); |
+ footer()->AddButton(button_wifi_); |
if (network_state_handler->IsTechnologyProhibited( |
NetworkTypePattern::WiFi())) { |
button_wifi_->SetState(views::Button::STATE_DISABLED); |
@@ -482,13 +486,13 @@ |
button_mobile_->SetToggledTooltipText(l10n_util::GetStringUTF16( |
IDS_ASH_STATUS_TRAY_NETWORK_TECHNOLOGY_ENFORCED_BY_POLICY)); |
} |
- title_row()->AddButton(button_mobile_); |
+ footer()->AddButton(button_mobile_); |
} |
views::View* info_throbber_container = new views::View(); |
InfoThrobberLayout* info_throbber_layout = new InfoThrobberLayout; |
info_throbber_container->SetLayoutManager(info_throbber_layout); |
- title_row()->AddView(info_throbber_container, true /* add_separator */); |
+ footer()->AddView(info_throbber_container, true /* add_separator */); |
if (list_type_ != LIST_TYPE_VPN) { |
// Place the throbber behind the info icon so that the icon receives |
@@ -557,12 +561,15 @@ |
AddChildView(bottom_row); |
} |
+// Update UI components. |
+ |
void NetworkStateListDetailedView::UpdateHeaderButtons() { |
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
if (button_wifi_) |
UpdateTechnologyButton(button_wifi_, NetworkTypePattern::WiFi()); |
- if (button_mobile_) |
+ if (button_mobile_) { |
UpdateTechnologyButton(button_mobile_, NetworkTypePattern::Mobile()); |
+ } |
if (proxy_settings_) |
proxy_settings_->SetEnabled(handler->DefaultNetwork() != nullptr); |
@@ -571,8 +578,7 @@ |
bool scanning = |
NetworkHandler::Get()->network_state_handler()->GetScanningByType( |
NetworkTypePattern::WiFi()); |
- if (scanning != wifi_scanning_ && |
- !MaterialDesignController::IsSystemTrayMenuMaterial()) { |
+ if (scanning != wifi_scanning_) { |
wifi_scanning_ = scanning; |
if (list_type_ != LIST_TYPE_VPN) { |
SetScanningStateForThrobberView(true); |
@@ -595,14 +601,11 @@ |
} |
} |
- static_cast<views::View*>(title_row())->Layout(); |
+ static_cast<views::View*>(footer())->Layout(); |
} |
void NetworkStateListDetailedView::SetScanningStateForThrobberView( |
bool is_scanning) { |
- if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
- return; |
- |
// Hide the network info button if the device is scanning for Wi-Fi networks |
// and display the WiFi scanning indicator. |
info_icon_->SetVisible(!is_scanning); |
@@ -922,10 +925,6 @@ |
return label; |
} |
-void NetworkStateListDetailedView::OnNetworkEntryClicked(views::View* sender) { |
- HandleViewClicked(sender); |
-} |
- |
void NetworkStateListDetailedView::RelayoutScrollList() { |
scroller()->Layout(); |
} |