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

Unified Diff: ash/wm/session_state_animator_impl.h

Issue 326813004: Added quick lock mechanism while in Touchview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ASH_EXPORT to SessionStateAnimator Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/session_state_animator.cc ('k') | ash/wm/session_state_animator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/session_state_animator_impl.h
diff --git a/ash/wm/session_state_animator_impl.h b/ash/wm/session_state_animator_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..bad7103164cccfc3a02d4158b9801353164abb83
--- /dev/null
+++ b/ash/wm/session_state_animator_impl.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_SESSION_STATE_ANIMATOR_IMPL_H_
+#define ASH_WM_SESSION_STATE_ANIMATOR_IMPL_H_
+
+#include "ash/ash_export.h"
+#include "ash/wm/session_state_animator.h"
+#include "base/basictypes.h"
+#include "ui/aura/window.h"
+
+namespace ui {
+class LayerAnimationObserver;
+}
+
+namespace ash {
+
+// Displays onscreen animations for session state changes (lock/unlock, sign
+// out, shut down).
+class ASH_EXPORT SessionStateAnimatorImpl : public SessionStateAnimator {
+ public:
+ // Helper class used by tests to access internal state.
+ class ASH_EXPORT TestApi {
+ public:
+ explicit TestApi(SessionStateAnimatorImpl* animator)
+ : animator_(animator) {}
+
+ // Returns true if containers of a given |container_mask|
+ // were last animated with |type| (probably; the analysis is fairly ad-hoc).
+ // |container_mask| is a bitfield of a Container.
+ bool ContainersAreAnimated(int container_mask,
+ SessionStateAnimator::AnimationType type) const;
+
+ // Returns true if root window was last animated with |type| (probably;
+ // the analysis is fairly ad-hoc).
+ bool RootWindowIsAnimated(SessionStateAnimator::AnimationType type) const;
+
+ private:
+ SessionStateAnimatorImpl* animator_; // not owned
+
+ DISALLOW_COPY_AND_ASSIGN(TestApi);
+ };
+
+ SessionStateAnimatorImpl();
+ virtual ~SessionStateAnimatorImpl();
+
+ // Fills |containers| with the containers included in |container_mask|.
+ static void GetContainers(int container_mask,
+ aura::Window::Windows* containers);
+
+ // ash::SessionStateAnimator:
+ virtual void StartAnimation(int container_mask,
+ AnimationType type,
+ AnimationSpeed speed) OVERRIDE;
+ virtual void StartAnimationWithCallback(
+ int container_mask,
+ AnimationType type,
+ AnimationSpeed speed,
+ base::Closure callback) OVERRIDE;
+ virtual AnimationSequence* BeginAnimationSequence(
+ base::Closure callback) OVERRIDE;
+ virtual bool IsBackgroundHidden() const OVERRIDE;
+ virtual void ShowBackground() OVERRIDE;
+ virtual void HideBackground() OVERRIDE;
+
+ private:
+ class AnimationSequence;
+ friend class AnimationSequence;
+
+ virtual void StartAnimationInSequence(int container_mask,
+ AnimationType type,
+ AnimationSpeed speed,
+ AnimationSequence* observer);
+
+ // Apply animation |type| to window |window| with |speed| and add |observer|
+ // if it is not NULL to the last animation sequence.
+ void RunAnimationForWindow(aura::Window* window,
+ SessionStateAnimator::AnimationType type,
+ SessionStateAnimator::AnimationSpeed speed,
+ ui::LayerAnimationObserver* observer);
+
+ DISALLOW_COPY_AND_ASSIGN(SessionStateAnimatorImpl);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_SESSION_STATE_ANIMATOR_IMPL_H_
« no previous file with comments | « ash/wm/session_state_animator.cc ('k') | ash/wm/session_state_animator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698