| 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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 case PRINT_WINDOW_HIERARCHY: | 1133 case PRINT_WINDOW_HIERARCHY: |
| 1134 return HandlePrintWindowHierarchy(); | 1134 return HandlePrintWindowHierarchy(); |
| 1135 default: | 1135 default: |
| 1136 NOTREACHED() << "Unhandled action " << action; | 1136 NOTREACHED() << "Unhandled action " << action; |
| 1137 } | 1137 } |
| 1138 return false; | 1138 return false; |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 void AcceleratorController::SetBrightnessControlDelegate( | 1141 void AcceleratorController::SetBrightnessControlDelegate( |
| 1142 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate) { | 1142 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate) { |
| 1143 // Install brightness control delegate only when internal | 1143 brightness_control_delegate_ = brightness_control_delegate.Pass(); |
| 1144 // display exists. | |
| 1145 if (Shell::GetInstance()->display_manager()->HasInternalDisplay() || | |
| 1146 CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1147 switches::kAshEnableBrightnessControl)) { | |
| 1148 brightness_control_delegate_ = brightness_control_delegate.Pass(); | |
| 1149 } | |
| 1150 } | 1144 } |
| 1151 | 1145 |
| 1152 void AcceleratorController::SetImeControlDelegate( | 1146 void AcceleratorController::SetImeControlDelegate( |
| 1153 scoped_ptr<ImeControlDelegate> ime_control_delegate) { | 1147 scoped_ptr<ImeControlDelegate> ime_control_delegate) { |
| 1154 ime_control_delegate_ = ime_control_delegate.Pass(); | 1148 ime_control_delegate_ = ime_control_delegate.Pass(); |
| 1155 } | 1149 } |
| 1156 | 1150 |
| 1157 void AcceleratorController::SetScreenshotDelegate( | 1151 void AcceleratorController::SetScreenshotDelegate( |
| 1158 scoped_ptr<ScreenshotDelegate> screenshot_delegate) { | 1152 scoped_ptr<ScreenshotDelegate> screenshot_delegate) { |
| 1159 screenshot_delegate_ = screenshot_delegate.Pass(); | 1153 screenshot_delegate_ = screenshot_delegate.Pass(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1189 keyboard_brightness_control_delegate) { | 1183 keyboard_brightness_control_delegate) { |
| 1190 keyboard_brightness_control_delegate_ = | 1184 keyboard_brightness_control_delegate_ = |
| 1191 keyboard_brightness_control_delegate.Pass(); | 1185 keyboard_brightness_control_delegate.Pass(); |
| 1192 } | 1186 } |
| 1193 | 1187 |
| 1194 bool AcceleratorController::CanHandleAccelerators() const { | 1188 bool AcceleratorController::CanHandleAccelerators() const { |
| 1195 return true; | 1189 return true; |
| 1196 } | 1190 } |
| 1197 | 1191 |
| 1198 } // namespace ash | 1192 } // namespace ash |
| OLD | NEW |