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

Side by Side Diff: ash/common/wm/overview/window_selector.h

Issue 2736753005: Converts WmActivationObserver to aura::client::ActivationChangeObserver (Closed)
Patch Set: cleanup Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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"
17 #include "base/macros.h" 16 #include "base/macros.h"
18 #include "base/time/time.h" 17 #include "base/time/time.h"
19 #include "ui/aura/window_observer.h" 18 #include "ui/aura/window_observer.h"
20 #include "ui/display/display_observer.h" 19 #include "ui/display/display_observer.h"
21 #include "ui/gfx/image/image_skia.h" 20 #include "ui/gfx/image/image_skia.h"
22 #include "ui/views/controls/textfield/textfield_controller.h" 21 #include "ui/views/controls/textfield/textfield_controller.h"
22 #include "ui/wm/public/activation_change_observer.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 class WmWindow;
34 35
35 // The WindowSelector shows a grid of all of your windows, allowing to select 36 // The WindowSelector shows a grid of all of your windows, allowing to select
36 // one by clicking or tapping on it. 37 // one by clicking or tapping on it.
37 class ASH_EXPORT WindowSelector : public display::DisplayObserver, 38 class ASH_EXPORT WindowSelector : public display::DisplayObserver,
38 public aura::WindowObserver, 39 public aura::WindowObserver,
39 public WmActivationObserver, 40 public aura::client::ActivationChangeObserver,
40 public views::TextfieldController { 41 public views::TextfieldController {
41 public: 42 public:
42 // Returns true if the window can be selected in overview mode. 43 // Returns true if the window can be selected in overview mode.
43 static bool IsSelectable(WmWindow* window); 44 static bool IsSelectable(WmWindow* window);
44 45
45 enum Direction { LEFT, UP, RIGHT, DOWN }; 46 enum Direction { LEFT, UP, RIGHT, DOWN };
46 47
47 using WindowList = std::vector<WmWindow*>; 48 using WindowList = std::vector<WmWindow*>;
48 49
49 explicit WindowSelector(WindowSelectorDelegate* delegate); 50 explicit WindowSelector(WindowSelectorDelegate* delegate);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // display::DisplayObserver: 89 // display::DisplayObserver:
89 void OnDisplayAdded(const display::Display& display) override; 90 void OnDisplayAdded(const display::Display& display) override;
90 void OnDisplayRemoved(const display::Display& display) override; 91 void OnDisplayRemoved(const display::Display& display) override;
91 void OnDisplayMetricsChanged(const display::Display& display, 92 void OnDisplayMetricsChanged(const display::Display& display,
92 uint32_t metrics) override; 93 uint32_t metrics) override;
93 94
94 // aura::WindowObserver: 95 // aura::WindowObserver:
95 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; 96 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override;
96 void OnWindowDestroying(aura::Window* window) override; 97 void OnWindowDestroying(aura::Window* window) override;
97 98
98 // WmActivationObserver 99 // aura::client::ActivationChangeObserver:
99 void OnWindowActivated(WmWindow* gained_active, 100 void OnWindowActivated(ActivationReason reason,
100 WmWindow* lost_active) override; 101 aura::Window* gained_active,
101 void OnAttemptToReactivateWindow(WmWindow* request_active, 102 aura::Window* lost_active) override;
102 WmWindow* actual_active) override; 103 void OnAttemptToReactivateWindow(aura::Window* request_active,
104 aura::Window* actual_active) override;
103 105
104 // views::TextfieldController: 106 // views::TextfieldController:
105 void ContentsChanged(views::Textfield* sender, 107 void ContentsChanged(views::Textfield* sender,
106 const base::string16& new_contents) override; 108 const base::string16& new_contents) override;
107 bool HandleKeyEvent(views::Textfield* sender, 109 bool HandleKeyEvent(views::Textfield* sender,
108 const ui::KeyEvent& key_event) override; 110 const ui::KeyEvent& key_event) override;
109 111
110 private: 112 private:
111 friend class WindowSelectorTest; 113 friend class WindowSelectorTest;
112 114
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 int text_filter_bottom_; 193 int text_filter_bottom_;
192 194
193 bool is_shut_down_ = false; 195 bool is_shut_down_ = false;
194 196
195 DISALLOW_COPY_AND_ASSIGN(WindowSelector); 197 DISALLOW_COPY_AND_ASSIGN(WindowSelector);
196 }; 198 };
197 199
198 } // namespace ash 200 } // namespace ash
199 201
200 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_ 202 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698