Commit b0595cf4 authored by Azeem Arshad's avatar Azeem Arshad Committed by Commit Bot

[Network Settings] Fix quick settings mobile data toggle animation

This CL fixes issue with "Mobile Data" toggle animating to the on
position when opening the menu instead of appearing in the on state
immediately. The issue was caused because the mobile data header view
always initializes with the toggle off. The correct value is updated
immediately after initialization. But this code path uses the toggle's
AnimateIsOn method that starts an animation. Fixed this by setting
correct initial state for mobile header view.

Fixed: 1020722
Change-Id: I8c17ce28b09b2506221fcbcbf472f80d44f67006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975111
Commit-Queue: Azeem Arshad <azeemarshad@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726241}
parent 73719d8e
...@@ -130,7 +130,11 @@ void NetworkSectionHeaderView::AddToggleButton(bool enabled) { ...@@ -130,7 +130,11 @@ void NetworkSectionHeaderView::AddToggleButton(bool enabled) {
MobileSectionHeaderView::MobileSectionHeaderView() MobileSectionHeaderView::MobileSectionHeaderView()
: NetworkSectionHeaderView(IDS_ASH_STATUS_TRAY_NETWORK_MOBILE) { : NetworkSectionHeaderView(IDS_ASH_STATUS_TRAY_NETWORK_MOBILE) {
NetworkSectionHeaderView::Init(false /* enabled */); bool initially_enabled = model()->GetDeviceState(NetworkType::kCellular) ==
DeviceStateType::kEnabled ||
model()->GetDeviceState(NetworkType::kTether) ==
DeviceStateType::kEnabled;
NetworkSectionHeaderView::Init(initially_enabled);
} }
MobileSectionHeaderView::~MobileSectionHeaderView() {} MobileSectionHeaderView::~MobileSectionHeaderView() {}
......
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