| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_IMMERSIVE_REVEALED_LOCK_H_ | 5 #ifndef ASH_WM_IMMERSIVE_REVEALED_LOCK_H_ |
| 6 #define ASH_WM_IMMERSIVE_REVEALED_LOCK_H_ | 6 #define ASH_WM_IMMERSIVE_REVEALED_LOCK_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 // Class which keeps the top-of-window views revealed for the duration of its | 14 // Class which keeps the top-of-window views revealed for the duration of its |
| 15 // lifetime. If acquiring the lock causes a reveal, the top-of-window views | 15 // lifetime. If acquiring the lock causes a reveal, the top-of-window views |
| 16 // will animate according to the |animate_reveal| parameter passed in the | 16 // will animate according to the |animate_reveal| parameter passed in the |
| 17 // constructor. See ImmersiveFullscreenController::GetRevealedLock() for more | 17 // constructor. See ImmersiveFullscreenController::GetRevealedLock() for more |
| 18 // details. | 18 // details. |
| 19 class ASH_EXPORT ImmersiveRevealedLock { | 19 class ASH_EXPORT ImmersiveRevealedLock { |
| 20 public: | 20 public: |
| 21 class ASH_EXPORT Delegate { | 21 class ASH_EXPORT Delegate { |
| 22 public: | 22 public: |
| 23 enum AnimateReveal { | 23 enum AnimateReveal { ANIMATE_REVEAL_YES, ANIMATE_REVEAL_NO }; |
| 24 ANIMATE_REVEAL_YES, | |
| 25 ANIMATE_REVEAL_NO | |
| 26 }; | |
| 27 | 24 |
| 28 virtual void LockRevealedState(AnimateReveal animate_reveal) = 0; | 25 virtual void LockRevealedState(AnimateReveal animate_reveal) = 0; |
| 29 virtual void UnlockRevealedState() = 0; | 26 virtual void UnlockRevealedState() = 0; |
| 30 | 27 |
| 31 protected: | 28 protected: |
| 32 virtual ~Delegate() {} | 29 virtual ~Delegate() {} |
| 33 }; | 30 }; |
| 34 | 31 |
| 35 ImmersiveRevealedLock(const base::WeakPtr<Delegate>& delegate, | 32 ImmersiveRevealedLock(const base::WeakPtr<Delegate>& delegate, |
| 36 Delegate::AnimateReveal animate_reveal); | 33 Delegate::AnimateReveal animate_reveal); |
| 37 ~ImmersiveRevealedLock(); | 34 ~ImmersiveRevealedLock(); |
| 38 | 35 |
| 39 private: | 36 private: |
| 40 base::WeakPtr<Delegate> delegate_; | 37 base::WeakPtr<Delegate> delegate_; |
| 41 | 38 |
| 42 DISALLOW_COPY_AND_ASSIGN(ImmersiveRevealedLock); | 39 DISALLOW_COPY_AND_ASSIGN(ImmersiveRevealedLock); |
| 43 }; | 40 }; |
| 44 | 41 |
| 45 } // namespace ash | 42 } // namespace ash |
| 46 | 43 |
| 47 #endif // ASH_WM_IMMERSIVE_REVEALED_LOCK_H_ | 44 #endif // ASH_WM_IMMERSIVE_REVEALED_LOCK_H_ |
| OLD | NEW |