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

Unified Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 10824142: Support toggling Wi-Fi with keyboard shortcut. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change the key conbination and messages for popup Created 8 years, 5 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
« ash/system/network/tray_network.cc ('K') | « ash/system/network/tray_network.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system/ash_system_tray_delegate.cc
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index f28867baa85986654352e70b9f980a4e236de086..9c7556a58a654865bd8244161f8b2aa8036cc8fb 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -689,7 +689,11 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
}
virtual void ToggleWifi() OVERRIDE {
+ bool old_wifi_enabled = GetWifiEnabled();
network_menu_->ToggleWifi();
+ // Use the old state to get the new state because Wi-Fi state is toggled
+ // asynchronously.
+ tray_->network_observer()->OnWifiToggled(!old_wifi_enabled);
Daniel Erat 2012/08/02 14:26:45 Is there any danger of this getting out of sync?
mazda 2012/08/02 17:14:30 TrayNetwork calls GetWifiEnabled, but it's called
Daniel Erat 2012/08/02 17:15:40 Sure, that sounds great to me. Thanks!
mazda 2012/08/02 19:49:16 Renamed OnWifiToggled to OnWillToggleWifi.
}
virtual void ToggleMobile() OVERRIDE {
« ash/system/network/tray_network.cc ('K') | « ash/system/network/tray_network.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698