| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/brightness/tray_brightness.h" | 5 #include "ash/system/chromeos/brightness/tray_brightness.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/ash_constants.h" | 8 #include "ash/ash_constants.h" |
| 9 #include "ash/metrics/user_metrics_recorder.h" | 9 #include "ash/metrics/user_metrics_recorder.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 brightness_view_ = NULL; | 194 brightness_view_ = NULL; |
| 195 } | 195 } |
| 196 | 196 |
| 197 void TrayBrightness::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 197 void TrayBrightness::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool TrayBrightness::ShouldHideArrow() const { | 200 bool TrayBrightness::ShouldHideArrow() const { |
| 201 return true; | 201 return true; |
| 202 } | 202 } |
| 203 | 203 |
| 204 bool TrayBrightness::ShouldShowLauncher() const { | 204 bool TrayBrightness::ShouldShowShelf() const { |
| 205 return false; | 205 return false; |
| 206 } | 206 } |
| 207 | 207 |
| 208 void TrayBrightness::BrightnessChanged(int level, bool user_initiated) { | 208 void TrayBrightness::BrightnessChanged(int level, bool user_initiated) { |
| 209 Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 209 Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| 210 ash::UMA_STATUS_AREA_BRIGHTNESS_CHANGED); | 210 ash::UMA_STATUS_AREA_BRIGHTNESS_CHANGED); |
| 211 double percent = static_cast<double>(level); | 211 double percent = static_cast<double>(level); |
| 212 HandleBrightnessChanged(percent, user_initiated); | 212 HandleBrightnessChanged(percent, user_initiated); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void TrayBrightness::HandleBrightnessChanged(double percent, | 215 void TrayBrightness::HandleBrightnessChanged(double percent, |
| 216 bool user_initiated) { | 216 bool user_initiated) { |
| 217 current_percent_ = percent; | 217 current_percent_ = percent; |
| 218 got_current_percent_ = true; | 218 got_current_percent_ = true; |
| 219 | 219 |
| 220 if (brightness_view_) | 220 if (brightness_view_) |
| 221 brightness_view_->SetBrightnessPercent(percent); | 221 brightness_view_->SetBrightnessPercent(percent); |
| 222 if (!user_initiated) | 222 if (!user_initiated) |
| 223 return; | 223 return; |
| 224 | 224 |
| 225 if (brightness_view_) | 225 if (brightness_view_) |
| 226 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 226 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 227 else | 227 else |
| 228 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 228 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace internal | 231 } // namespace internal |
| 232 } // namespace ash | 232 } // namespace ash |
| OLD | NEW |