Chromium Code Reviews| 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 #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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | |
| 10 | |
| 9 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 10 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time.h" | 14 #include "base/time.h" |
| 13 #include "base/timer.h" | 15 #include "base/timer.h" |
| 14 #include "ui/aura/root_window_observer.h" | 16 #include "ui/aura/root_window_observer.h" |
| 17 #include "ui/aura/window.h" | |
|
Daniel Erat
2012/02/15 05:50:03
forward-declare aura::Window instead of including
alicet1
2012/02/15 20:48:53
I lifted GetContainers up to class, and so it need
| |
| 15 | 18 |
| 16 namespace gfx { | 19 namespace gfx { |
| 17 class Size; | 20 class Size; |
| 18 } | 21 } |
| 19 | 22 |
| 20 namespace ui { | 23 namespace ui { |
| 21 class Layer; | 24 class Layer; |
| 25 class Transform; | |
| 22 } | 26 } |
| 23 | 27 |
| 24 namespace ash { | 28 namespace ash { |
| 25 | 29 |
| 30 typedef std::map<aura::Window*, ui::Transform> WindowTransformsMap; | |
|
Daniel Erat
2012/02/15 05:50:03
move this inside of the class, in the private bloc
alicet1
2012/02/15 20:48:53
Done.
| |
| 31 typedef WindowTransformsMap::const_iterator WindowTransformsConstIter; | |
|
Daniel Erat
2012/02/15 05:50:03
don't put this in the header; you don't use it the
alicet1
2012/02/15 20:48:53
Done.
| |
| 32 | |
| 26 // Performs system-related functions on behalf of PowerButtonController. | 33 // Performs system-related functions on behalf of PowerButtonController. |
| 27 class ASH_EXPORT PowerButtonControllerDelegate { | 34 class ASH_EXPORT PowerButtonControllerDelegate { |
| 28 public: | 35 public: |
| 29 PowerButtonControllerDelegate() {} | 36 PowerButtonControllerDelegate() {} |
| 30 virtual ~PowerButtonControllerDelegate() {} | 37 virtual ~PowerButtonControllerDelegate() {} |
| 31 | 38 |
| 32 virtual void RequestLockScreen() = 0; | 39 virtual void RequestLockScreen() = 0; |
| 33 virtual void RequestShutdown() = 0; | 40 virtual void RequestShutdown() = 0; |
| 34 | 41 |
| 35 private: | 42 private: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 } | 118 } |
| 112 | 119 |
| 113 // Returns true if the given set of containers was last animated with | 120 // Returns true if the given set of containers was last animated with |
| 114 // |type| (probably; the analysis is fairly ad-hoc). | 121 // |type| (probably; the analysis is fairly ad-hoc). |
| 115 bool ContainerGroupIsAnimated(ContainerGroup group, | 122 bool ContainerGroupIsAnimated(ContainerGroup group, |
| 116 AnimationType type) const; | 123 AnimationType type) const; |
| 117 | 124 |
| 118 // Returns true if |background_layer_| is non-NULL and visible. | 125 // Returns true if |background_layer_| is non-NULL and visible. |
| 119 bool BackgroundLayerIsVisible() const; | 126 bool BackgroundLayerIsVisible() const; |
| 120 | 127 |
| 128 // Returns the set of |windows| in a container |group|. | |
| 129 void GetContainerWindows(ContainerGroup group, | |
|
Daniel Erat
2012/02/15 05:50:03
this name (and especially the comment) are mislead
alicet1
2012/02/15 20:48:53
removed.
I moved GetContainers to public, either
| |
| 130 aura::Window::Windows* windows); | |
| 121 private: | 131 private: |
| 122 PowerButtonController* controller_; // not owned | 132 PowerButtonController* controller_; // not owned |
| 123 | 133 |
| 124 DISALLOW_COPY_AND_ASSIGN(TestApi); | 134 DISALLOW_COPY_AND_ASSIGN(TestApi); |
| 125 }; | 135 }; |
| 126 | 136 |
| 127 PowerButtonController(); | 137 PowerButtonController(); |
| 128 virtual ~PowerButtonController(); | 138 virtual ~PowerButtonController(); |
| 129 | 139 |
| 130 void set_delegate(PowerButtonControllerDelegate* delegate) { | 140 void set_delegate(PowerButtonControllerDelegate* delegate) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 // Started when we display the shutdown animation. When it fires, we actually | 238 // Started when we display the shutdown animation. When it fires, we actually |
| 229 // request shutdown. Gives the animation time to complete before Chrome, X, | 239 // request shutdown. Gives the animation time to complete before Chrome, X, |
| 230 // etc. are shut down. | 240 // etc. are shut down. |
| 231 base::OneShotTimer<PowerButtonController> real_shutdown_timer_; | 241 base::OneShotTimer<PowerButtonController> real_shutdown_timer_; |
| 232 | 242 |
| 233 // Started when we abort the pre-lock state. When it fires, we hide | 243 // Started when we abort the pre-lock state. When it fires, we hide |
| 234 // |background_layer_|, as the desktop background is now covering the whole | 244 // |background_layer_|, as the desktop background is now covering the whole |
| 235 // screen. | 245 // screen. |
| 236 base::OneShotTimer<PowerButtonController> hide_background_layer_timer_; | 246 base::OneShotTimer<PowerButtonController> hide_background_layer_timer_; |
| 237 | 247 |
| 248 // Map of window and their corresponding layer transform before animation. | |
|
Daniel Erat
2012/02/15 05:50:03
// Map from containers to their original layer tra
alicet1
2012/02/15 20:48:53
Done.
| |
| 249 WindowTransformsMap window_transforms_; | |
|
Daniel Erat
2012/02/15 05:50:03
rename to container_transforms_
alicet1
2012/02/15 20:48:53
Done.
| |
| 250 | |
| 238 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); | 251 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); |
| 239 }; | 252 }; |
| 240 | 253 |
| 241 } // namespace ash | 254 } // namespace ash |
| 242 | 255 |
| 243 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 256 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
| OLD | NEW |