| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |