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

Side by Side Diff: ash/common/wm/lock_layout_manager.h

Issue 2747543002: ash: Start/stop observing KeyboardController via ShellObserver (Closed)
Patch Set: update LockLayoutManager to use similar logic 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_LOCK_LAYOUT_MANAGER_H_ 5 #ifndef ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_
6 #define ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ 6 #define ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/shell_observer.h" 9 #include "ash/common/shell_observer.h"
10 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" 10 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h"
11 #include "ash/common/wm/wm_types.h" 11 #include "ash/common/wm/wm_types.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/scoped_observer.h"
13 #include "ui/aura/window_observer.h" 14 #include "ui/aura/window_observer.h"
14 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
15 #include "ui/keyboard/keyboard_controller.h" 16 #include "ui/keyboard/keyboard_controller.h"
16 #include "ui/keyboard/keyboard_controller_observer.h" 17 #include "ui/keyboard/keyboard_controller_observer.h"
17 18
18 namespace ash { 19 namespace ash {
19 namespace wm { 20 namespace wm {
20 class WindowState; 21 class WindowState;
21 class WMEvent; 22 class WMEvent;
22 } 23 }
(...skipping 27 matching lines...) Expand all
50 void SetChildBounds(WmWindow* child, 51 void SetChildBounds(WmWindow* child,
51 const gfx::Rect& requested_bounds) override; 52 const gfx::Rect& requested_bounds) override;
52 53
53 // Overriden from aura::WindowObserver: 54 // Overriden from aura::WindowObserver:
54 void OnWindowDestroying(aura::Window* window) override; 55 void OnWindowDestroying(aura::Window* window) override;
55 void OnWindowBoundsChanged(aura::Window* window, 56 void OnWindowBoundsChanged(aura::Window* window,
56 const gfx::Rect& old_bounds, 57 const gfx::Rect& old_bounds,
57 const gfx::Rect& new_bounds) override; 58 const gfx::Rect& new_bounds) override;
58 59
59 // ShellObserver: 60 // ShellObserver:
60 void OnVirtualKeyboardStateChanged(bool activated) override; 61 void OnVirtualKeyboardStateChanged(bool activated,
62 WmWindow* root_window) override;
61 63
62 // keyboard::KeyboardControllerObserver overrides: 64 // keyboard::KeyboardControllerObserver overrides:
63 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; 65 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override;
64 void OnKeyboardClosed() override; 66 void OnKeyboardClosed() override;
65 67
66 private: 68 private:
67 // Adjusts the bounds of all managed windows when the display area changes. 69 // Adjusts the bounds of all managed windows when the display area changes.
68 // This happens when the display size, work area insets has changed. 70 // This happens when the display size, work area insets has changed.
69 void AdjustWindowsForWorkAreaChange(const wm::WMEvent* event); 71 void AdjustWindowsForWorkAreaChange(const wm::WMEvent* event);
70 72
71 WmWindow* window_; 73 WmWindow* window_;
72 WmWindow* root_window_; 74 WmWindow* root_window_;
73 75
74 // True is subscribed as keyboard controller observer. 76 ScopedObserver<keyboard::KeyboardController,
75 bool is_observing_keyboard_; 77 keyboard::KeyboardControllerObserver>
78 keyboard_observer_;
76 79
77 // The bounds of the keyboard. 80 // The bounds of the keyboard.
78 gfx::Rect keyboard_bounds_; 81 gfx::Rect keyboard_bounds_;
79 82
80 DISALLOW_COPY_AND_ASSIGN(LockLayoutManager); 83 DISALLOW_COPY_AND_ASSIGN(LockLayoutManager);
81 }; 84 };
82 85
83 } // namespace ash 86 } // namespace ash
84 87
85 #endif // ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_ 88 #endif // ASH_COMMON_WM_LOCK_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/common/wm/dock/docked_window_layout_manager.cc ('k') | ash/common/wm/lock_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698