Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: ash/system/chromeos/power/tablet_power_button_controller.h

Issue 2533373002: Enabled/disable touch screen in TabletPowerButtonController (Closed)
Patch Set: add SetTouchscreenEnabled and OnLoginStateChanged Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/chromeos/power/tablet_power_button_controller.h
diff --git a/ash/system/chromeos/power/tablet_power_button_controller.h b/ash/system/chromeos/power/tablet_power_button_controller.h
index 66a5b61de06058e5b0529b0648b2e59d9cf1563d..46df12c052412017d35f0d5094e9f5fd6bb11d61 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller.h
+++ b/ash/system/chromeos/power/tablet_power_button_controller.h
@@ -8,6 +8,7 @@
#include <memory>
#include "ash/ash_export.h"
+#include "ash/common/shell_observer.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/tick_clock.h"
@@ -25,6 +26,7 @@ class LockStateController;
// instantiated and used in PowerButtonController.
class ASH_EXPORT TabletPowerButtonController
: public chromeos::PowerManagerClient::Observer,
+ public ShellObserver,
public ui::EventHandler,
public ui::InputDeviceEventObserver {
public:
@@ -61,6 +63,9 @@ class ASH_EXPORT TabletPowerButtonController
void BrightnessChanged(int level, bool user_initiated) override;
void SuspendDone(const base::TimeDelta& sleep_duration) override;
+ // Overridden from ShellObserver:
+ void OnLoginStateChanged(LoginStatus status) override;
Qiang(Joe) Xu 2016/11/30 22:09:11 This change is to fix the bug for this: On user lo
+
// Overridden from ui::EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override;
void OnMouseEvent(ui::MouseEvent* event) override;
@@ -72,8 +77,9 @@ class ASH_EXPORT TabletPowerButtonController
void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock);
private:
- // Set backlights to |forced_off| if they aren't already.
- void SetBacklightsForcedOff(bool forced_off);
+ // Set backlights to |forced_off| and the corresponding enabled state of
+ // touchscreen if they aren't already.
+ void SetDisplayForcedOff(bool forced_off);
// Sends a request to powerd to get the backlights forced off state so that
// |backlights_forced_off_| can be initialized.

Powered by Google App Engine
This is Rietveld 408576698