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

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

Issue 2747543002: ash: Start/stop observing KeyboardController via ShellObserver (Closed)
Patch Set: pass root_window to OnVirtualKeyboardStateChanged() 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 #include "ash/common/wm/lock_layout_manager.h" 5 #include "ash/common/wm/lock_layout_manager.h"
6 6
7 #include "ash/common/wm/lock_window_state.h" 7 #include "ash/common/wm/lock_window_state.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/common/wm/wm_event.h" 9 #include "ash/common/wm/wm_event.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 void LockLayoutManager::OnWindowBoundsChanged(aura::Window* window, 82 void LockLayoutManager::OnWindowBoundsChanged(aura::Window* window,
83 const gfx::Rect& old_bounds, 83 const gfx::Rect& old_bounds,
84 const gfx::Rect& new_bounds) { 84 const gfx::Rect& new_bounds) {
85 if (root_window_ == WmWindow::Get(window)) { 85 if (root_window_ == WmWindow::Get(window)) {
86 const wm::WMEvent wm_event(wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED); 86 const wm::WMEvent wm_event(wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED);
87 AdjustWindowsForWorkAreaChange(&wm_event); 87 AdjustWindowsForWorkAreaChange(&wm_event);
88 } 88 }
89 } 89 }
90 90
91 void LockLayoutManager::OnVirtualKeyboardStateChanged(bool activated) { 91 void LockLayoutManager::OnVirtualKeyboardStateChanged(bool activated,
92 WmWindow* root_window) {
92 if (keyboard::KeyboardController::GetInstance()) { 93 if (keyboard::KeyboardController::GetInstance()) {
93 if (activated) { 94 if (activated) {
94 if (!is_observing_keyboard_) { 95 if (!is_observing_keyboard_) {
95 keyboard::KeyboardController::GetInstance()->AddObserver(this); 96 keyboard::KeyboardController::GetInstance()->AddObserver(this);
96 is_observing_keyboard_ = true; 97 is_observing_keyboard_ = true;
97 } 98 }
98 } else { 99 } else {
99 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); 100 keyboard::KeyboardController::GetInstance()->RemoveObserver(this);
100 is_observing_keyboard_ = false; 101 is_observing_keyboard_ = false;
101 } 102 }
(...skipping 10 matching lines...) Expand all
112 void LockLayoutManager::AdjustWindowsForWorkAreaChange( 113 void LockLayoutManager::AdjustWindowsForWorkAreaChange(
113 const wm::WMEvent* event) { 114 const wm::WMEvent* event) {
114 DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED || 115 DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED ||
115 event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); 116 event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED);
116 117
117 for (WmWindow* child : window_->GetChildren()) 118 for (WmWindow* child : window_->GetChildren())
118 child->GetWindowState()->OnWMEvent(event); 119 child->GetWindowState()->OnWMEvent(event);
119 } 120 }
120 121
121 } // namespace ash 122 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698