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

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

Issue 2613493002: Fix namespace for src/ui/display/. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
« no previous file with comments | « ash/wm/lock_state_controller_unittest.cc ('k') | ash/wm/power_button_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // Handles power & lock button events which may result in the locking or 27 // Handles power & lock button events which may result in the locking or
28 // shutting down of the system as well as taking screen shots while in maximize 28 // shutting down of the system as well as taking screen shots while in maximize
29 // mode. 29 // mode.
30 class ASH_EXPORT PowerButtonController 30 class ASH_EXPORT PowerButtonController
31 : public ui::EventHandler 31 : public ui::EventHandler
32 // TODO(derat): Remove these ifdefs after DisplayConfigurator becomes 32 // TODO(derat): Remove these ifdefs after DisplayConfigurator becomes
33 // cross-platform. 33 // cross-platform.
34 #if defined(OS_CHROMEOS) 34 #if defined(OS_CHROMEOS)
35 , 35 ,
36 public ui::DisplayConfigurator::Observer, 36 public display::DisplayConfigurator::Observer,
37 public chromeos::PowerManagerClient::Observer 37 public chromeos::PowerManagerClient::Observer
38 #endif 38 #endif
39 { 39 {
40 public: 40 public:
41 explicit PowerButtonController(LockStateController* controller); 41 explicit PowerButtonController(LockStateController* controller);
42 ~PowerButtonController() override; 42 ~PowerButtonController() override;
43 43
44 void set_has_legacy_power_button_for_test(bool legacy) { 44 void set_has_legacy_power_button_for_test(bool legacy) {
45 has_legacy_power_button_ = legacy; 45 has_legacy_power_button_ = legacy;
46 } 46 }
47 47
48 // Called when the current screen brightness changes. 48 // Called when the current screen brightness changes.
49 void OnScreenBrightnessChanged(double percent); 49 void OnScreenBrightnessChanged(double percent);
50 50
51 // Called when the power or lock buttons are pressed or released. 51 // Called when the power or lock buttons are pressed or released.
52 void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp); 52 void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp);
53 void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp); 53 void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp);
54 54
55 // ui::EventHandler: 55 // ui::EventHandler:
56 void OnKeyEvent(ui::KeyEvent* event) override; 56 void OnKeyEvent(ui::KeyEvent* event) override;
57 57
58 #if defined(OS_CHROMEOS) 58 #if defined(OS_CHROMEOS)
59 // Overriden from ui::DisplayConfigurator::Observer: 59 // Overriden from display::DisplayConfigurator::Observer:
60 void OnDisplayModeChanged( 60 void OnDisplayModeChanged(
61 const ui::DisplayConfigurator::DisplayStateList& outputs) override; 61 const display::DisplayConfigurator::DisplayStateList& outputs) override;
62 62
63 // Overridden from chromeos::PowerManagerClient::Observer: 63 // Overridden from chromeos::PowerManagerClient::Observer:
64 void PowerButtonEventReceived(bool down, 64 void PowerButtonEventReceived(bool down,
65 const base::TimeTicks& timestamp) override; 65 const base::TimeTicks& timestamp) override;
66 66
67 TabletPowerButtonController* tablet_power_button_controller_for_test() { 67 TabletPowerButtonController* tablet_power_button_controller_for_test() {
68 return tablet_controller_.get(); 68 return tablet_controller_.get();
69 } 69 }
70 #endif 70 #endif
71 71
(...skipping 29 matching lines...) Expand all
101 // Handles events for convertible/tablet devices. 101 // Handles events for convertible/tablet devices.
102 std::unique_ptr<TabletPowerButtonController> tablet_controller_; 102 std::unique_ptr<TabletPowerButtonController> tablet_controller_;
103 #endif 103 #endif
104 104
105 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); 105 DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
106 }; 106 };
107 107
108 } // namespace ash 108 } // namespace ash
109 109
110 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ 110 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/wm/lock_state_controller_unittest.cc ('k') | ash/wm/power_button_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698