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

Side by Side Diff: ash/common/wm/panels/panel_layout_manager.h

Issue 2747543002: ash: Start/stop observing KeyboardController via ShellObserver (Closed)
Patch Set: rebase 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PANELS_PANEL_LAYOUT_MANAGER_H_ 5 #ifndef ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
6 #define ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ 6 #define ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/common/shelf/wm_shelf_observer.h" 12 #include "ash/common/shelf/wm_shelf_observer.h"
13 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
14 #include "ash/common/wm/window_state_observer.h" 14 #include "ash/common/wm/window_state_observer.h"
15 #include "ash/common/wm_display_observer.h" 15 #include "ash/common/wm_display_observer.h"
16 #include "ash/common/wm_layout_manager.h" 16 #include "ash/common/wm_layout_manager.h"
17 #include "ash/root_window_controller.h" 17 #include "ash/root_window_controller.h"
18 #include "base/compiler_specific.h" 18 #include "base/compiler_specific.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/memory/weak_ptr.h" 20 #include "base/memory/weak_ptr.h"
21 #include "base/scoped_observer.h"
21 #include "ui/aura/window_observer.h" 22 #include "ui/aura/window_observer.h"
22 #include "ui/aura/window_tracker.h" 23 #include "ui/aura/window_tracker.h"
23 #include "ui/keyboard/keyboard_controller.h" 24 #include "ui/keyboard/keyboard_controller.h"
24 #include "ui/keyboard/keyboard_controller_observer.h" 25 #include "ui/keyboard/keyboard_controller_observer.h"
25 #include "ui/wm/public/activation_change_observer.h" 26 #include "ui/wm/public/activation_change_observer.h"
26 27
27 namespace gfx { 28 namespace gfx {
28 class Rect; 29 class Rect;
29 } 30 }
30 31
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 aura::Window* gained_active, 111 aura::Window* gained_active,
111 aura::Window* lost_active) override; 112 aura::Window* lost_active) override;
112 113
113 // Overridden from WindowTreeHostManager::Observer 114 // Overridden from WindowTreeHostManager::Observer
114 void OnDisplayConfigurationChanged() override; 115 void OnDisplayConfigurationChanged() override;
115 116
116 // Overridden from WmShelfObserver 117 // Overridden from WmShelfObserver
117 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; 118 void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
118 void OnShelfIconPositionsChanged() override; 119 void OnShelfIconPositionsChanged() override;
119 120
121 void StartObservingKeyboard(
122 keyboard::KeyboardController* keyboard_controller);
123 void StopObservingKeyboard(keyboard::KeyboardController* keyboard_controller);
124
120 private: 125 private:
121 friend class PanelLayoutManagerTest; 126 friend class PanelLayoutManagerTest;
122 friend class PanelWindowResizerTest; 127 friend class PanelWindowResizerTest;
123 friend class DockedWindowResizerTest; 128 friend class DockedWindowResizerTest;
124 friend class DockedWindowLayoutManagerTest; 129 friend class DockedWindowLayoutManagerTest;
125 friend class WorkspaceControllerTest; 130 friend class WorkspaceControllerTest;
126 friend class AcceleratorControllerTest; 131 friend class AcceleratorControllerTest;
127 132
128 views::Widget* CreateCalloutWidget(); 133 views::Widget* CreateCalloutWidget();
129 134
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 WmShelf* shelf_; 194 WmShelf* shelf_;
190 195
191 // When not NULL, the shelf is hidden (i.e. full screen) and this tracks the 196 // When not NULL, the shelf is hidden (i.e. full screen) and this tracks the
192 // set of panel windows which have been temporarily hidden and need to be 197 // set of panel windows which have been temporarily hidden and need to be
193 // restored when the shelf becomes visible again. 198 // restored when the shelf becomes visible again.
194 std::unique_ptr<aura::WindowTracker> restore_windows_on_shelf_visible_; 199 std::unique_ptr<aura::WindowTracker> restore_windows_on_shelf_visible_;
195 200
196 // The last active panel. Used to maintain stacking order even if no panels 201 // The last active panel. Used to maintain stacking order even if no panels
197 // are currently focused. 202 // are currently focused.
198 WmWindow* last_active_panel_; 203 WmWindow* last_active_panel_;
204
205 ScopedObserver<keyboard::KeyboardController,
206 keyboard::KeyboardControllerObserver>
207 keyboard_observer_;
208
199 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; 209 base::WeakPtrFactory<PanelLayoutManager> weak_factory_;
200 210
201 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); 211 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager);
202 }; 212 };
203 213
204 } // namespace ash 214 } // namespace ash
205 215
206 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ 216 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698