| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| 11 #include "ash/metrics/user_metrics_recorder.h" | 11 #include "ash/metrics/user_metrics_recorder.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/shell_observer.h" | 13 #include "ash/shell_observer.h" |
| 14 #include "ash/system/brightness_control_delegate.h" | 14 #include "ash/system/brightness_control_delegate.h" |
| 15 #include "ash/system/tray/fixed_sized_image_view.h" | 15 #include "ash/system/tray/fixed_sized_image_view.h" |
| 16 #include "ash/system/tray/system_tray_delegate.h" | 16 #include "ash/system/tray/system_tray_delegate.h" |
| 17 #include "ash/system/tray/system_tray_notifier.h" | 17 #include "ash/system/tray/system_tray_notifier.h" |
| 18 #include "ash/system/tray/tray_constants.h" | 18 #include "ash/system/tray/tray_constants.h" |
| 19 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 19 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 20 #include "base/bind.h" | 20 #include "base/bind.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 22 #include "base/thread_task_runner_handle.h" | 22 #include "base/thread_task_runner_handle.h" |
| 23 #include "chromeos/dbus/dbus_thread_manager.h" | 23 #include "chromeos/dbus/dbus_thread_manager.h" |
| 24 #include "chromeos/dbus/power_manager_client.h" | 24 #include "chromeos/dbus/power_manager_client.h" |
| 25 #include "grit/ash_resources.h" | 25 #include "grit/ash_resources.h" |
| 26 #include "grit/ash_strings.h" | 26 #include "grit/ash_strings.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 28 #include "ui/gfx/display.h" | 28 #include "ui/display/display.h" |
| 29 #include "ui/gfx/image/image.h" | 29 #include "ui/gfx/image/image.h" |
| 30 #include "ui/views/controls/button/image_button.h" | 30 #include "ui/views/controls/button/image_button.h" |
| 31 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
| 32 #include "ui/views/controls/label.h" | 32 #include "ui/views/controls/label.h" |
| 33 #include "ui/views/controls/slider.h" | 33 #include "ui/views/controls/slider.h" |
| 34 #include "ui/views/layout/box_layout.h" | 34 #include "ui/views/layout/box_layout.h" |
| 35 #include "ui/views/view.h" | 35 #include "ui/views/view.h" |
| 36 | 36 |
| 37 namespace ash { | 37 namespace ash { |
| 38 namespace tray { | 38 namespace tray { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 265 |
| 266 if (brightness_view_) | 266 if (brightness_view_) |
| 267 brightness_view_->SetBrightnessPercent(percent); | 267 brightness_view_->SetBrightnessPercent(percent); |
| 268 | 268 |
| 269 if (!user_initiated) | 269 if (!user_initiated) |
| 270 return; | 270 return; |
| 271 | 271 |
| 272 // Never show the bubble on systems that lack internal displays: if an | 272 // Never show the bubble on systems that lack internal displays: if an |
| 273 // external display's brightness is changed, it may already display the new | 273 // external display's brightness is changed, it may already display the new |
| 274 // level via an on-screen display. | 274 // level via an on-screen display. |
| 275 if (!gfx::Display::HasInternalDisplay()) | 275 if (!display::Display::HasInternalDisplay()) |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 if (brightness_view_) | 278 if (brightness_view_) |
| 279 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); | 279 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); |
| 280 else | 280 else |
| 281 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 281 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace ash | 284 } // namespace ash |
| OLD | NEW |