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

Side by Side Diff: ash/wm/power_button_controller.h

Issue 187073002: Refactoring display configuration state to allow generic state objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef ASH_WM_POWER_BUTTON_CONTROLLER_H_ 5 #ifndef ASH_WM_POWER_BUTTON_CONTROLLER_H_
6 #define ASH_WM_POWER_BUTTON_CONTROLLER_H_ 6 #define ASH_WM_POWER_BUTTON_CONTROLLER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/session_state_animator.h" 9 #include "ash/wm/session_state_animator.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // Called when the current screen brightness changes. 50 // Called when the current screen brightness changes.
51 void OnScreenBrightnessChanged(double percent); 51 void OnScreenBrightnessChanged(double percent);
52 52
53 // Called when the power or lock buttons are pressed or released. 53 // Called when the power or lock buttons are pressed or released.
54 void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp); 54 void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp);
55 void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp); 55 void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp);
56 56
57 #if defined(OS_CHROMEOS) && defined(USE_X11) 57 #if defined(OS_CHROMEOS) && defined(USE_X11)
58 // Overriden from chromeos::OutputConfigurator::Observer: 58 // Overriden from chromeos::OutputConfigurator::Observer:
59 virtual void OnDisplayModeChanged( 59 virtual void OnDisplayModeChanged(const std::vector<
60 const std::vector<chromeos::OutputConfigurator::OutputSnapshot>& outputs) 60 chromeos::OutputConfigurator::InternalDisplayState>& outputs) OVERRIDE;
61 OVERRIDE;
62 #endif 61 #endif
63 62
64 private: 63 private:
65 friend class test::PowerButtonControllerTest; 64 friend class test::PowerButtonControllerTest;
66 65
67 // Are the power or lock buttons currently held? 66 // Are the power or lock buttons currently held?
68 bool power_button_down_; 67 bool power_button_down_;
69 bool lock_button_down_; 68 bool lock_button_down_;
70 69
71 // Has the screen brightness been reduced to 0%? 70 // Has the screen brightness been reduced to 0%?
72 bool brightness_is_zero_; 71 bool brightness_is_zero_;
73 72
74 // True if an internal display is off while an external display is on (e.g. 73 // True if an internal display is off while an external display is on (e.g.
75 // for Chrome OS's docked mode, where a Chromebook's lid is closed while an 74 // for Chrome OS's docked mode, where a Chromebook's lid is closed while an
76 // external display is connected). 75 // external display is connected).
77 bool internal_display_off_and_external_display_on_; 76 bool internal_display_off_and_external_display_on_;
78 77
79 // Was a command-line switch set telling us that we're running on hardware 78 // Was a command-line switch set telling us that we're running on hardware
80 // that misreports power button releases? 79 // that misreports power button releases?
81 bool has_legacy_power_button_; 80 bool has_legacy_power_button_;
82 81
83 LockStateController* controller_; // Not owned. 82 LockStateController* controller_; // Not owned.
84 83
85 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); 84 DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
86 }; 85 };
87 86
88 } // namespace ash 87 } // namespace ash
89 88
90 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ 89 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698