| 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/power_button_controller.h" | 5 #include "ash/wm/power_button_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #endif | 37 #endif |
| 38 brightness_is_zero_(false), | 38 brightness_is_zero_(false), |
| 39 internal_display_off_and_external_display_on_(false), | 39 internal_display_off_and_external_display_on_(false), |
| 40 has_legacy_power_button_( | 40 has_legacy_power_button_( |
| 41 base::CommandLine::ForCurrentProcess()->HasSwitch( | 41 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 42 switches::kAuraLegacyPowerButton)), | 42 switches::kAuraLegacyPowerButton)), |
| 43 lock_state_controller_(controller) { | 43 lock_state_controller_(controller) { |
| 44 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
| 45 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( | 45 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( |
| 46 this); | 46 this); |
| 47 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 47 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kAshEnableTouchView) || |
| 48 switches::kAshEnableTabletPowerButton)) { | 48 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 49 kAshEnableTouchViewTesting)) { |
| 49 tablet_controller_.reset( | 50 tablet_controller_.reset( |
| 50 new TabletPowerButtonController(lock_state_controller_)); | 51 new TabletPowerButtonController(lock_state_controller_)); |
| 51 } | 52 } |
| 52 Shell::GetInstance()->display_configurator()->AddObserver(this); | 53 Shell::GetInstance()->display_configurator()->AddObserver(this); |
| 53 #endif | 54 #endif |
| 54 Shell::GetInstance()->PrependPreTargetHandler(this); | 55 Shell::GetInstance()->PrependPreTargetHandler(this); |
| 55 } | 56 } |
| 56 | 57 |
| 57 PowerButtonController::~PowerButtonController() { | 58 PowerButtonController::~PowerButtonController() { |
| 58 Shell::GetInstance()->RemovePreTargetHandler(this); | 59 Shell::GetInstance()->RemovePreTargetHandler(this); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 209 } |
| 209 | 210 |
| 210 void PowerButtonController::PowerButtonEventReceived( | 211 void PowerButtonController::PowerButtonEventReceived( |
| 211 bool down, | 212 bool down, |
| 212 const base::TimeTicks& timestamp) { | 213 const base::TimeTicks& timestamp) { |
| 213 OnPowerButtonEvent(down, timestamp); | 214 OnPowerButtonEvent(down, timestamp); |
| 214 } | 215 } |
| 215 #endif // defined(OS_CHROMEOS) | 216 #endif // defined(OS_CHROMEOS) |
| 216 | 217 |
| 217 } // namespace ash | 218 } // namespace ash |
| OLD | NEW |