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

Side by Side Diff: ash/system/brightness/tray_brightness.cc

Issue 10200006: ash: Refresh the tray items, instead of recreating them, when login status changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« no previous file with comments | « ash/system/brightness/tray_brightness.h ('k') | ash/system/date/tray_date.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/system/brightness/tray_brightness.h" 5 #include "ash/system/brightness/tray_brightness.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/brightness/brightness_control_delegate.h" 9 #include "ash/system/brightness/brightness_control_delegate.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 void TrayBrightness::DestroyDefaultView() { 177 void TrayBrightness::DestroyDefaultView() {
178 if (is_default_view_) 178 if (is_default_view_)
179 brightness_view_.reset(); 179 brightness_view_.reset();
180 } 180 }
181 181
182 void TrayBrightness::DestroyDetailedView() { 182 void TrayBrightness::DestroyDetailedView() {
183 if (!is_default_view_) 183 if (!is_default_view_)
184 brightness_view_.reset(); 184 brightness_view_.reset();
185 } 185 }
186 186
187 void TrayBrightness::UpdateAfterLoginStatusChange(user::LoginStatus status) {
188 }
189
187 void TrayBrightness::OnBrightnessChanged(double percent, bool user_initiated) { 190 void TrayBrightness::OnBrightnessChanged(double percent, bool user_initiated) {
188 current_percent_ = percent; 191 current_percent_ = percent;
189 got_current_percent_ = true; 192 got_current_percent_ = true;
190 193
191 if (brightness_view_.get()) 194 if (brightness_view_.get())
192 brightness_view_->SetBrightnessPercent(percent); 195 brightness_view_->SetBrightnessPercent(percent);
193 if (!user_initiated) 196 if (!user_initiated)
194 return; 197 return;
195 198
196 if (brightness_view_.get()) 199 if (brightness_view_.get())
197 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); 200 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds);
198 else 201 else
199 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); 202 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false);
200 } 203 }
201 204
202 } // namespace internal 205 } // namespace internal
203 } // namespace ash 206 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/brightness/tray_brightness.h ('k') | ash/system/date/tray_date.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698