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

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

Issue 1704803002: Disable wifi scans on the VPN tray detailed view (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke ThrobberPressed; don't create scanning_throbber_ for VPN list Created 4 years, 10 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 f45ce15a7b5350e8dd7c198da4131c58ea185ecd..1885903a265c54600c675fca27c602762063d57c 100644
--- a/ash/system/chromeos/network/network_state_list_detailed_view.cc
+++ b/ash/system/chromeos/network/network_state_list_detailed_view.cc
@@ -4,6 +4,7 @@
#include "ash/system/chromeos/network/network_state_list_detailed_view.h"
+#include <algorithm>
#include <vector>
#include "ash/ash_constants.h"
@@ -337,7 +338,8 @@ void NetworkStateListDetailedView::Init() {
network_list_view_->set_container(scroll_content());
Update();
- CallRequestScan();
+ if (list_type_ != LIST_TYPE_VPN)
+ CallRequestScan();
}
NetworkDetailedView::DetailedViewType
@@ -388,14 +390,6 @@ void NetworkStateListDetailedView::ButtonPressed(views::Button* sender,
}
}
-bool NetworkStateListDetailedView::ThrobberPressed(views::View* sender,
- const ui::Event& event) {
- if (sender != scanning_throbber_)
- return false;
- ToggleInfoBubble();
- return true;
-}
-
void NetworkStateListDetailedView::OnViewClicked(views::View* sender) {
// If the info bubble was visible, close it when some other item is clicked.
ResetInfoBubble();
@@ -479,10 +473,13 @@ void NetworkStateListDetailedView::CreateHeaderEntry() {
info_throbber_container->SetLayoutManager(info_throbber_layout);
footer()->AddView(info_throbber_container, true /* add_separator */);
- // Place the throbber behind the info icon so that the icon receives
- // click / touch events. The info icon is hidden when the throbber is active.
- scanning_throbber_ = new ScanningThrobber();
- info_throbber_container->AddChildView(scanning_throbber_);
+ if (list_type_ != LIST_TYPE_VPN) {
+ // Place the throbber behind the info icon so that the icon receives
+ // click / touch events. The info icon is hidden when the throbber is
+ // active.
+ scanning_throbber_ = new ScanningThrobber();
+ info_throbber_container->AddChildView(scanning_throbber_);
+ }
info_icon_ = new InfoIcon(this);
info_icon_->SetTooltipText(
@@ -554,24 +551,26 @@ void NetworkStateListDetailedView::UpdateHeaderButtons() {
if (proxy_settings_)
proxy_settings_->SetEnabled(handler->DefaultNetwork() != nullptr);
- // Update Wifi Scanning throbber.
- bool scanning =
- NetworkHandler::Get()->network_state_handler()->GetScanningByType(
- NetworkTypePattern::WiFi());
- if (scanning != wifi_scanning_) {
- wifi_scanning_ = scanning;
- if (scanning) {
- info_icon_->SetVisible(false);
- scanning_throbber_->SetVisible(true);
- scanning_throbber_->Start();
- scanning_throbber_->SetTooltipText(
- l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_WIFI_SCANNING_MESSAGE));
- } else {
- scanning_throbber_->Stop();
- scanning_throbber_->SetVisible(false);
- scanning_throbber_->SetTooltipText(
- l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_INFO));
- info_icon_->SetVisible(true);
+ if (list_type_ != LIST_TYPE_VPN) {
+ // Update Wifi Scanning throbber.
+ bool scanning =
+ NetworkHandler::Get()->network_state_handler()->GetScanningByType(
+ NetworkTypePattern::WiFi());
+ if (scanning != wifi_scanning_) {
+ wifi_scanning_ = scanning;
+ if (scanning && list_type_ != LIST_TYPE_VPN) {
+ info_icon_->SetVisible(false);
+ scanning_throbber_->SetVisible(true);
+ scanning_throbber_->Start();
+ scanning_throbber_->SetTooltipText(l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_WIFI_SCANNING_MESSAGE));
+ } else {
+ scanning_throbber_->Stop();
+ scanning_throbber_->SetVisible(false);
+ scanning_throbber_->SetTooltipText(
+ l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_INFO));
+ info_icon_->SetVisible(true);
+ }
}
}
« 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