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

Unified Diff: ash/wm/lock_layout_manager.cc

Issue 2871813002: Converts remaining usage of WmLayoutManager to aura::LayoutManager (Closed)
Patch Set: cleanup Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/lock_layout_manager.h ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/lock_layout_manager.cc
diff --git a/ash/wm/lock_layout_manager.cc b/ash/wm/lock_layout_manager.cc
index 32cdf7217baa44534856283b1cd913956a8cacf0..2ad40948ef237f2d1e7cb85306b2b247b94047a4 100644
--- a/ash/wm/lock_layout_manager.cc
+++ b/ash/wm/lock_layout_manager.cc
@@ -8,6 +8,7 @@
#include "ash/shell.h"
#include "ash/wm/lock_window_state.h"
#include "ash/wm/window_state.h"
+#include "ash/wm/window_state_aura.h"
#include "ash/wm/wm_event.h"
#include "ash/wm_window.h"
#include "ui/events/event.h"
@@ -16,23 +17,23 @@
namespace ash {
-LockLayoutManager::LockLayoutManager(WmWindow* window)
+LockLayoutManager::LockLayoutManager(aura::Window* window)
: wm::WmSnapToPixelLayoutManager(),
window_(window),
root_window_(window->GetRootWindow()),
keyboard_observer_(this) {
Shell::Get()->AddShellObserver(this);
- root_window_->aura_window()->AddObserver(this);
+ root_window_->AddObserver(this);
if (keyboard::KeyboardController::GetInstance())
keyboard_observer_.Add(keyboard::KeyboardController::GetInstance());
}
LockLayoutManager::~LockLayoutManager() {
if (root_window_)
- root_window_->aura_window()->RemoveObserver(this);
+ root_window_->RemoveObserver(this);
- for (WmWindow* child : window_->GetChildren())
- child->aura_window()->RemoveObserver(this);
+ for (aura::Window* child : window_->children())
+ child->RemoveObserver(this);
Shell::Get()->RemoveShellObserver(this);
}
@@ -42,48 +43,50 @@ void LockLayoutManager::OnWindowResized() {
AdjustWindowsForWorkAreaChange(&event);
}
-void LockLayoutManager::OnWindowAddedToLayout(WmWindow* child) {
- child->aura_window()->AddObserver(this);
+void LockLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
+ child->AddObserver(this);
// LockWindowState replaces default WindowState of a child.
- wm::WindowState* window_state = LockWindowState::SetLockWindowState(child);
+ wm::WindowState* window_state =
+ LockWindowState::SetLockWindowState(WmWindow::Get(child));
wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE);
window_state->OnWMEvent(&event);
}
-void LockLayoutManager::OnWillRemoveWindowFromLayout(WmWindow* child) {
- child->aura_window()->RemoveObserver(this);
+void LockLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {
+ child->RemoveObserver(this);
}
-void LockLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {}
+void LockLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {}
-void LockLayoutManager::OnChildWindowVisibilityChanged(WmWindow* child,
+void LockLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
bool visible) {}
-void LockLayoutManager::SetChildBounds(WmWindow* child,
+void LockLayoutManager::SetChildBounds(aura::Window* child,
const gfx::Rect& requested_bounds) {
- wm::WindowState* window_state = child->GetWindowState();
+ wm::WindowState* window_state = wm::GetWindowState(child);
wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds);
window_state->OnWMEvent(&event);
}
void LockLayoutManager::OnWindowDestroying(aura::Window* window) {
window->RemoveObserver(this);
- if (root_window_ == WmWindow::Get(window))
+ if (root_window_ == window)
root_window_ = nullptr;
}
void LockLayoutManager::OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
- if (root_window_ == WmWindow::Get(window)) {
+ if (root_window_ == window) {
const wm::WMEvent wm_event(wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED);
AdjustWindowsForWorkAreaChange(&wm_event);
}
}
-void LockLayoutManager::OnVirtualKeyboardStateChanged(bool activated,
- WmWindow* root_window) {
+void LockLayoutManager::OnVirtualKeyboardStateChanged(
+ bool activated,
+ aura::Window* root_window) {
UpdateKeyboardObserverFromStateChanged(activated, root_window, root_window_,
&keyboard_observer_);
}
@@ -102,8 +105,8 @@ void LockLayoutManager::AdjustWindowsForWorkAreaChange(
DCHECK(event->type() == wm::WM_EVENT_DISPLAY_BOUNDS_CHANGED ||
event->type() == wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED);
- for (WmWindow* child : window_->GetChildren())
- child->GetWindowState()->OnWMEvent(event);
+ for (aura::Window* child : window_->children())
+ wm::GetWindowState(child)->OnWMEvent(event);
}
} // namespace ash
« no previous file with comments | « ash/wm/lock_layout_manager.h ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698