| 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_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ | 5 #ifndef ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
| 6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ | 6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "ash/ash_export.h" | 15 #include "ash/ash_export.h" |
| 16 #include "ash/common/wm_activation_observer.h" | 16 #include "ash/common/wm_activation_observer.h" |
| 17 #include "ash/common/wm_window_observer.h" | |
| 18 #include "base/macros.h" | 17 #include "base/macros.h" |
| 19 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "ui/aura/window_observer.h" |
| 20 #include "ui/display/display_observer.h" | 20 #include "ui/display/display_observer.h" |
| 21 #include "ui/gfx/image/image_skia.h" | 21 #include "ui/gfx/image/image_skia.h" |
| 22 #include "ui/views/controls/textfield/textfield_controller.h" | 22 #include "ui/views/controls/textfield/textfield_controller.h" |
| 23 | 23 |
| 24 namespace views { | 24 namespace views { |
| 25 class Textfield; | 25 class Textfield; |
| 26 class Widget; | 26 class Widget; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace ash { | 29 namespace ash { |
| 30 class WindowSelectorDelegate; | 30 class WindowSelectorDelegate; |
| 31 class WindowSelectorItem; | 31 class WindowSelectorItem; |
| 32 class WindowSelectorTest; | 32 class WindowSelectorTest; |
| 33 class WindowGrid; | 33 class WindowGrid; |
| 34 | 34 |
| 35 // The WindowSelector shows a grid of all of your windows, allowing to select | 35 // The WindowSelector shows a grid of all of your windows, allowing to select |
| 36 // one by clicking or tapping on it. | 36 // one by clicking or tapping on it. |
| 37 class ASH_EXPORT WindowSelector : public display::DisplayObserver, | 37 class ASH_EXPORT WindowSelector : public display::DisplayObserver, |
| 38 public WmWindowObserver, | 38 public aura::WindowObserver, |
| 39 public WmActivationObserver, | 39 public WmActivationObserver, |
| 40 public views::TextfieldController { | 40 public views::TextfieldController { |
| 41 public: | 41 public: |
| 42 // Returns true if the window can be selected in overview mode. | 42 // Returns true if the window can be selected in overview mode. |
| 43 static bool IsSelectable(WmWindow* window); | 43 static bool IsSelectable(WmWindow* window); |
| 44 | 44 |
| 45 enum Direction { LEFT, UP, RIGHT, DOWN }; | 45 enum Direction { LEFT, UP, RIGHT, DOWN }; |
| 46 | 46 |
| 47 using WindowList = std::vector<WmWindow*>; | 47 using WindowList = std::vector<WmWindow*>; |
| 48 | 48 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 int text_filter_bottom() const { return text_filter_bottom_; } | 84 int text_filter_bottom() const { return text_filter_bottom_; } |
| 85 | 85 |
| 86 bool is_shut_down() const { return is_shut_down_; } | 86 bool is_shut_down() const { return is_shut_down_; } |
| 87 | 87 |
| 88 // display::DisplayObserver: | 88 // display::DisplayObserver: |
| 89 void OnDisplayAdded(const display::Display& display) override; | 89 void OnDisplayAdded(const display::Display& display) override; |
| 90 void OnDisplayRemoved(const display::Display& display) override; | 90 void OnDisplayRemoved(const display::Display& display) override; |
| 91 void OnDisplayMetricsChanged(const display::Display& display, | 91 void OnDisplayMetricsChanged(const display::Display& display, |
| 92 uint32_t metrics) override; | 92 uint32_t metrics) override; |
| 93 | 93 |
| 94 // WmWindowObserver: | 94 // aura::WindowObserver: |
| 95 void OnWindowTreeChanged(WmWindow* window, | 95 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; |
| 96 const TreeChangeParams& params) override; | 96 void OnWindowDestroying(aura::Window* window) override; |
| 97 void OnWindowDestroying(WmWindow* window) override; | |
| 98 | 97 |
| 99 // WmActivationObserver | 98 // WmActivationObserver |
| 100 void OnWindowActivated(WmWindow* gained_active, | 99 void OnWindowActivated(WmWindow* gained_active, |
| 101 WmWindow* lost_active) override; | 100 WmWindow* lost_active) override; |
| 102 void OnAttemptToReactivateWindow(WmWindow* request_active, | 101 void OnAttemptToReactivateWindow(WmWindow* request_active, |
| 103 WmWindow* actual_active) override; | 102 WmWindow* actual_active) override; |
| 104 | 103 |
| 105 // views::TextfieldController: | 104 // views::TextfieldController: |
| 106 void ContentsChanged(views::Textfield* sender, | 105 void ContentsChanged(views::Textfield* sender, |
| 107 const base::string16& new_contents) override; | 106 const base::string16& new_contents) override; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 int text_filter_bottom_; | 191 int text_filter_bottom_; |
| 193 | 192 |
| 194 bool is_shut_down_ = false; | 193 bool is_shut_down_ = false; |
| 195 | 194 |
| 196 DISALLOW_COPY_AND_ASSIGN(WindowSelector); | 195 DISALLOW_COPY_AND_ASSIGN(WindowSelector); |
| 197 }; | 196 }; |
| 198 | 197 |
| 199 } // namespace ash | 198 } // namespace ash |
| 200 | 199 |
| 201 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ | 200 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ |
| OLD | NEW |