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

Unified Diff: ash/wm/window_selector.h

Issue 20415002: Add window overview mode behind --ash-enable-overview-mode flag to F5 key. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove implicit cast to bool. Created 7 years, 5 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/shell_delegate.h ('k') | ash/wm/window_selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_selector.h
diff --git a/ash/wm/window_selector.h b/ash/wm/window_selector.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f15ba2bf71c8e6e17f82632141e2b3a4845cf14
--- /dev/null
+++ b/ash/wm/window_selector.h
@@ -0,0 +1,79 @@
+// Copyright (c) 2013 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_WINDOW_SELECTOR_H_
+#define ASH_WM_WINDOW_SELECTOR_H_
+
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "ui/aura/window_observer.h"
+#include "ui/base/events/event_handler.h"
+#include "ui/gfx/transform.h"
+
+namespace aura {
+class RootWindow;
+}
+
+namespace ash {
+
+class WindowSelectorDelegate;
+
+// The WindowSelector shows a grid of all of your windows and allows selecting
+// a window by clicking or tapping on it.
+class WindowSelector : public ui::EventHandler,
+ public aura::WindowObserver {
+ public:
+ typedef std::vector<aura::Window*> WindowList;
+
+ WindowSelector(const WindowList& windows,
+ WindowSelectorDelegate* delegate);
+ virtual ~WindowSelector();
+
+ // ui::EventHandler:
+ virtual void OnEvent(ui::Event* event) OVERRIDE;
+ virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+
+ // aura::WindowObserver:
+ virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
+
+ private:
+ struct WindowDetails {
+ WindowDetails() : window(NULL), minimized(false) {}
+
+ bool operator==(const aura::Window* other_window) const {
+ return window == other_window;
+ }
+
+ // A weak pointer to the window.
+ aura::Window* window;
+
+ // If true, the window was minimized and this should be restored if the
+ // window was not selected.
+ bool minimized;
+
+ // The original transform of the window before entering overview mode.
+ gfx::Transform original_transform;
+ };
+
+ void HandleSelectionEvent(ui::Event* event);
+ void PositionWindows();
+ void PositionWindowsOnRoot(aura::RootWindow* root_window);
+
+ void SelectWindow(aura::Window*);
+
+ // List of weak pointers of windows to select from.
+ std::vector<WindowDetails> windows_;
+
+ // Weak pointer to the selector delegate which will be called when a
+ // selection is made.
+ WindowSelectorDelegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowSelector);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_WINDOW_SELECTOR_H_
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/wm/window_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698