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

Unified Diff: ash/wm/lock_window_state.h

Issue 254673004: Add LockLayoutManager responsible for lock container (login/lock). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cl Created 6 years, 6 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
Index: ash/wm/lock_window_state.h
diff --git a/ash/wm/lock_window_state.h b/ash/wm/lock_window_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..3f46cbab1bc88e1f16b908c2cd99d4545cf80bee
--- /dev/null
+++ b/ash/wm/lock_window_state.h
@@ -0,0 +1,58 @@
+// Copyright 2014 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_LOCK_WINDOW_STATE_H_
+#define ASH_WM_LOCK_WINDOW_STATE_H_
+
+#include "ash/wm/window_state.h"
+
+namespace ash {
+
+// The LockWindowState implementation which reduces all possible window
+// states to maximized and is applied only on lock (login) window container.
+// LockWindowState implements Ash behavior without state machine.
+class LockWindowState : public wm::WindowState::State {
+ public:
+ // The |window|'s state object will be modified to use this new window mode
+ // state handler.
+ explicit LockWindowState(aura::Window* window);
+ virtual ~LockWindowState();
+
+ // WindowState::State overrides:
+ virtual void OnWMEvent(wm::WindowState* window_state,
+ const wm::WMEvent* event) OVERRIDE;
+
+ virtual wm::WindowStateType GetType() const OVERRIDE;
+ virtual void AttachState(wm::WindowState* window_state,
+ wm::WindowState::State* previous_state) OVERRIDE;
+ virtual void DetachState(wm::WindowState* window_state) OVERRIDE;
+
+ private:
+ // Updates the window to |new_state_type| and resulting bounds:
+ // Either full screen, maximized centered or minimized. If the state does not
+ // change, only the bounds will be changed.
+ void UpdateWindow(wm::WindowState* window_state,
+ wm::WindowStateType new_state_type);
+
+ // Depending on the capabilities of the window we either return
+ // |WINDOW_STATE_TYPE_MAXIMIZED| or |WINDOW_STATE_TYPE_NORMAL|.
+ wm::WindowStateType GetMaximizedOrCenteredWindowType(
+ wm::WindowState* window_state);
+
+ // Updates the bounds taking virtual keyboard bounds into consideration.
+ void UpdateBounds(wm::WindowState* window_state);
+
+ // The state object for this object which owns this instance.
+ aura::Window* window_;
oshima 2014/06/04 19:20:14 I believe you don't need this (you can always get
Nikita (slow) 2014/06/05 10:51:37 Done.
+
+ // The current state type. Due to the nature of this state, this can only be
+ // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}.
+ wm::WindowStateType current_state_type_;
+
+ DISALLOW_COPY_AND_ASSIGN(LockWindowState);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_LOCK_WINDOW_STATE_H_

Powered by Google App Engine
This is Rietveld 408576698