OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/maximize_mode/maximize_mode_controller.h" | 5 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 have_seen_accelerometer_data_(false), | 120 have_seen_accelerometer_data_(false), |
121 ignore_display_configuration_updates_(false), | 121 ignore_display_configuration_updates_(false), |
122 lid_open_past_180_(false), | 122 lid_open_past_180_(false), |
123 shutting_down_(false), | 123 shutting_down_(false), |
124 user_rotation_(gfx::Display::ROTATE_0), | 124 user_rotation_(gfx::Display::ROTATE_0), |
125 last_touchview_transition_time_(base::Time::Now()), | 125 last_touchview_transition_time_(base::Time::Now()), |
126 tick_clock_(new base::DefaultTickClock()), | 126 tick_clock_(new base::DefaultTickClock()), |
127 lid_is_closed_(false) { | 127 lid_is_closed_(false) { |
128 Shell::GetInstance()->AddShellObserver(this); | 128 Shell::GetInstance()->AddShellObserver(this); |
129 #if defined(OS_CHROMEOS) | 129 #if defined(OS_CHROMEOS) |
130 Shell::GetInstance()->accelerometer_reader()->AddObserver(this); | 130 chromeos::AccelerometerReader::GetInstance()->AddObserver(this); |
131 chromeos::DBusThreadManager::Get()-> | 131 chromeos::DBusThreadManager::Get()-> |
132 GetPowerManagerClient()->AddObserver(this); | 132 GetPowerManagerClient()->AddObserver(this); |
133 #endif // OS_CHROMEOS | 133 #endif // OS_CHROMEOS |
134 } | 134 } |
135 | 135 |
136 MaximizeModeController::~MaximizeModeController() { | 136 MaximizeModeController::~MaximizeModeController() { |
137 Shell::GetInstance()->RemoveShellObserver(this); | 137 Shell::GetInstance()->RemoveShellObserver(this); |
138 #if defined(OS_CHROMEOS) | 138 #if defined(OS_CHROMEOS) |
139 Shell::GetInstance()->accelerometer_reader()->RemoveObserver(this); | 139 chromeos::AccelerometerReader::GetInstance()->RemoveObserver(this); |
140 chromeos::DBusThreadManager::Get()-> | 140 chromeos::DBusThreadManager::Get()-> |
141 GetPowerManagerClient()->RemoveObserver(this); | 141 GetPowerManagerClient()->RemoveObserver(this); |
142 #endif // OS_CHROMEOS | 142 #endif // OS_CHROMEOS |
143 } | 143 } |
144 | 144 |
145 void MaximizeModeController::SetRotationLocked(bool rotation_locked) { | 145 void MaximizeModeController::SetRotationLocked(bool rotation_locked) { |
146 if (rotation_locked_ == rotation_locked) | 146 if (rotation_locked_ == rotation_locked) |
147 return; | 147 return; |
148 base::AutoReset<bool> auto_ignore_display_configuration_updates( | 148 base::AutoReset<bool> auto_ignore_display_configuration_updates( |
149 &ignore_display_configuration_updates_, true); | 149 &ignore_display_configuration_updates_, true); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return elapsed_time <= kLidRecentlyOpenedDuration; | 508 return elapsed_time <= kLidRecentlyOpenedDuration; |
509 } | 509 } |
510 | 510 |
511 void MaximizeModeController::SetTickClockForTest( | 511 void MaximizeModeController::SetTickClockForTest( |
512 scoped_ptr<base::TickClock> tick_clock) { | 512 scoped_ptr<base::TickClock> tick_clock) { |
513 DCHECK(tick_clock_); | 513 DCHECK(tick_clock_); |
514 tick_clock_ = tick_clock.Pass(); | 514 tick_clock_ = tick_clock.Pass(); |
515 } | 515 } |
516 | 516 |
517 } // namespace ash | 517 } // namespace ash |
OLD | NEW |