| OLD | NEW |
| 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/wm/gestures/bezel_gesture_handler.h" | 5 #include "ash/wm/gestures/bezel_gesture_handler.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| 11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/shell_delegate.h" | 13 #include "ash/shell_delegate.h" |
| 14 #include "ash/system/brightness/brightness_control_delegate.h" | 14 #include "ash/system/brightness/brightness_control_delegate.h" |
| 15 #include "ash/system/tray/system_tray_delegate.h" | 15 #include "ash/system/tray/system_tray_delegate.h" |
| 16 #include "ash/volume_control_delegate.h" | 16 #include "ash/volume_control_delegate.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
| 19 #include "ui/base/event.h" | 19 #include "ui/base/events/event.h" |
| 20 #include "ui/base/ui_base_switches.h" | 20 #include "ui/base/ui_base_switches.h" |
| 21 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Device bezel operation constants (volume/brightness slider). | 25 // Device bezel operation constants (volume/brightness slider). |
| 26 | 26 |
| 27 // This is the minimal brightness value allowed for the display. | 27 // This is the minimal brightness value allowed for the display. |
| 28 const double kMinBrightnessPercent = 5.0; | 28 const double kMinBrightnessPercent = 5.0; |
| 29 // For device operation, the finger is not allowed to enter the screen more | 29 // For device operation, the finger is not allowed to enter the screen more |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // Turning off the display makes no sense, so we map the accessible range to | 277 // Turning off the display makes no sense, so we map the accessible range to |
| 278 // kMinimumBrightness .. 100%. | 278 // kMinimumBrightness .. 100%. |
| 279 percent = (percent + kMinBrightnessPercent) * 100.0 / | 279 percent = (percent + kMinBrightnessPercent) * 100.0 / |
| 280 (100.0 + kMinBrightnessPercent); | 280 (100.0 + kMinBrightnessPercent); |
| 281 // Clamp to avoid rounding issues. | 281 // Clamp to avoid rounding issues. |
| 282 return std::min(percent, 100.0); | 282 return std::min(percent, 100.0); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace internal | 285 } // namespace internal |
| 286 } // namespace ash | 286 } // namespace ash |
| OLD | NEW |