Commit df0970e7 authored by Toshiki Kikuchi's avatar Toshiki Kikuchi Committed by Commit Bot

Disable Network button in lock screen.

Changing network settings is not allowed in lock screen. In previous
implementation, network button is enabled and able to click even in lock screen.

TEST=manual
BUG=865333

Change-Id: I1986b353d1cdbe698a5390a7861cdf804cc5990d
Reviewed-on: https://chromium-review.googlesource.com/1156189Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Toshiki Kikuchi <toshikikikuchi@google.com>
Cr-Commit-Position: refs/heads/master@{#579742}
parent ae237f46
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "ash/system/network/network_feature_pod_controller.h" #include "ash/system/network/network_feature_pod_controller.h"
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/session/session_controller.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/system/network/network_feature_pod_button.h" #include "ash/system/network/network_feature_pod_button.h"
#include "ash/system/unified/unified_system_tray_controller.h" #include "ash/system/unified/unified_system_tray_controller.h"
...@@ -62,6 +64,7 @@ NetworkFeaturePodController::~NetworkFeaturePodController() = default; ...@@ -62,6 +64,7 @@ NetworkFeaturePodController::~NetworkFeaturePodController() = default;
FeaturePodButton* NetworkFeaturePodController::CreateButton() { FeaturePodButton* NetworkFeaturePodController::CreateButton() {
DCHECK(!button_); DCHECK(!button_);
button_ = new NetworkFeaturePodButton(this); button_ = new NetworkFeaturePodButton(this);
UpdateButton();
return button_; return button_;
} }
...@@ -84,4 +87,10 @@ SystemTrayItemUmaType NetworkFeaturePodController::GetUmaType() const { ...@@ -84,4 +87,10 @@ SystemTrayItemUmaType NetworkFeaturePodController::GetUmaType() const {
return SystemTrayItemUmaType::UMA_NETWORK; return SystemTrayItemUmaType::UMA_NETWORK;
} }
void NetworkFeaturePodController::UpdateButton() {
// Network setting is always immutable in lock screen.
SessionController* session_controller = Shell::Get()->session_controller();
button_->SetEnabled(!session_controller->IsScreenLocked());
}
} // namespace ash } // namespace ash
...@@ -26,6 +26,8 @@ class NetworkFeaturePodController : public FeaturePodControllerBase { ...@@ -26,6 +26,8 @@ class NetworkFeaturePodController : public FeaturePodControllerBase {
SystemTrayItemUmaType GetUmaType() const override; SystemTrayItemUmaType GetUmaType() const override;
private: private:
void UpdateButton();
// Unowned. // Unowned.
UnifiedSystemTrayController* tray_controller_; UnifiedSystemTrayController* tray_controller_;
FeaturePodButton* button_ = nullptr; FeaturePodButton* button_ = nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment