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

Side by Side Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 9983002: Pass correct initial/user values when requesting power status (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add SystemTrayDelegate::RequestStatusUpdate Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/system/audio/audio_observer.h" 9 #include "ash/system/audio/audio_observer.h"
10 #include "ash/system/bluetooth/bluetooth_observer.h" 10 #include "ash/system/bluetooth/bluetooth_observer.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 virtual int GetSystemUpdateIconResource() const OVERRIDE { 237 virtual int GetSystemUpdateIconResource() const OVERRIDE {
238 return UpgradeDetector::GetInstance()->GetIconResourceID( 238 return UpgradeDetector::GetInstance()->GetIconResourceID(
239 UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON); 239 UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON);
240 } 240 }
241 241
242 virtual base::HourClockType GetHourClockType() const OVERRIDE { 242 virtual base::HourClockType GetHourClockType() const OVERRIDE {
243 return clock_type_; 243 return clock_type_;
244 } 244 }
245 245
246 virtual PowerSupplyStatus GetPowerSupplyStatus() const OVERRIDE { 246 virtual PowerSupplyStatus GetPowerSupplyStatus() const OVERRIDE {
247 // Explicitly query the power status.
248 DBusThreadManager::Get()->GetPowerManagerClient()->RequestStatusUpdate(
249 PowerManagerClient::UPDATE_USER);
250 return power_supply_status_; 247 return power_supply_status_;
251 } 248 }
252 249
250 virtual void RequestStatusUpdate() const OVERRIDE {
251 DBusThreadManager::Get()->GetPowerManagerClient()->RequestStatusUpdate(
252 PowerManagerClient::UPDATE_USER);
253 }
254
253 virtual void ShowSettings() OVERRIDE { 255 virtual void ShowSettings() OVERRIDE {
254 GetAppropriateBrowser()->OpenOptionsDialog(); 256 GetAppropriateBrowser()->OpenOptionsDialog();
255 } 257 }
256 258
257 virtual void ShowDateSettings() OVERRIDE { 259 virtual void ShowDateSettings() OVERRIDE {
258 GetAppropriateBrowser()->ShowDateOptions(); 260 GetAppropriateBrowser()->ShowDateOptions();
259 } 261 }
260 262
261 virtual void ShowNetworkSettings() OVERRIDE { 263 virtual void ShowNetworkSettings() OVERRIDE {
262 GetAppropriateBrowser()->OpenInternetOptionsDialog(); 264 GetAppropriateBrowser()->OpenInternetOptionsDialog();
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 971 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
970 }; 972 };
971 973
972 } // namespace 974 } // namespace
973 975
974 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { 976 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) {
975 return new chromeos::SystemTrayDelegate(tray); 977 return new chromeos::SystemTrayDelegate(tray);
976 } 978 }
977 979
978 } // namespace chromeos 980 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698