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

Side by Side Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 2895713002: [mus+ash] Removes WmWindow from ash/wm/mru_window_tracker and overview mode (Closed)
Patch Set: Address nits, unit_tests target compiles 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 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 #include "ash/wm/workspace/workspace_layout_manager.h" 5 #include "ash/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/keyboard/keyboard_observer_register.h" 9 #include "ash/keyboard/keyboard_observer_register.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 wm::WindowState* window_state = wm::GetWindowState(child); 80 wm::WindowState* window_state = wm::GetWindowState(child);
81 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); 81 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE);
82 window_state->OnWMEvent(&event); 82 window_state->OnWMEvent(&event);
83 windows_.insert(child); 83 windows_.insert(child);
84 child->AddObserver(this); 84 child->AddObserver(this);
85 window_state->AddObserver(this); 85 window_state->AddObserver(this);
86 UpdateShelfVisibility(); 86 UpdateShelfVisibility();
87 UpdateFullscreenState(); 87 UpdateFullscreenState();
88 88
89 backdrop_controller_->OnWindowAddedToLayout(child); 89 backdrop_controller_->OnWindowAddedToLayout(child);
90 WindowPositioner::RearrangeVisibleWindowOnShow(WmWindow::Get(child)); 90 WindowPositioner::RearrangeVisibleWindowOnShow(child);
91 if (Shell::Get()->screen_pinning_controller()->IsPinned()) 91 if (Shell::Get()->screen_pinning_controller()->IsPinned())
92 wm::GetWindowState(child)->DisableAlwaysOnTop(nullptr); 92 wm::GetWindowState(child)->DisableAlwaysOnTop(nullptr);
93 } 93 }
94 94
95 void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { 95 void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {
96 windows_.erase(child); 96 windows_.erase(child);
97 child->RemoveObserver(this); 97 child->RemoveObserver(this);
98 wm::GetWindowState(child)->RemoveObserver(this); 98 wm::GetWindowState(child)->RemoveObserver(this);
99 99
100 if (child->layer()->GetTargetVisibility()) 100 if (child->layer()->GetTargetVisibility())
101 WindowPositioner::RearrangeVisibleWindowOnHideOrRemove( 101 WindowPositioner::RearrangeVisibleWindowOnHideOrRemove(child);
102 WmWindow::Get(child));
103 } 102 }
104 103
105 void WorkspaceLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { 104 void WorkspaceLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
106 UpdateShelfVisibility(); 105 UpdateShelfVisibility();
107 UpdateFullscreenState(); 106 UpdateFullscreenState();
108 backdrop_controller_->OnWindowRemovedFromLayout(child); 107 backdrop_controller_->OnWindowRemovedFromLayout(child);
109 } 108 }
110 109
111 void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, 110 void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child,
112 bool visible) { 111 bool visible) {
113 wm::WindowState* window_state = wm::GetWindowState(child); 112 wm::WindowState* window_state = wm::GetWindowState(child);
114 // Attempting to show a minimized window. Unminimize it. 113 // Attempting to show a minimized window. Unminimize it.
115 if (visible && window_state->IsMinimized()) 114 if (visible && window_state->IsMinimized())
116 window_state->Unminimize(); 115 window_state->Unminimize();
117 116
118 if (child->layer()->GetTargetVisibility()) 117 if (child->layer()->GetTargetVisibility())
119 WindowPositioner::RearrangeVisibleWindowOnShow(WmWindow::Get(child)); 118 WindowPositioner::RearrangeVisibleWindowOnShow(child);
120 else 119 else
121 WindowPositioner::RearrangeVisibleWindowOnHideOrRemove( 120 WindowPositioner::RearrangeVisibleWindowOnHideOrRemove(child);
122 WmWindow::Get(child));
123 UpdateFullscreenState(); 121 UpdateFullscreenState();
124 UpdateShelfVisibility(); 122 UpdateShelfVisibility();
125 backdrop_controller_->OnChildWindowVisibilityChanged(child, visible); 123 backdrop_controller_->OnChildWindowVisibilityChanged(child, visible);
126 } 124 }
127 125
128 void WorkspaceLayoutManager::SetChildBounds(aura::Window* child, 126 void WorkspaceLayoutManager::SetChildBounds(aura::Window* child,
129 const gfx::Rect& requested_bounds) { 127 const gfx::Rect& requested_bounds) {
130 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); 128 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds);
131 wm::GetWindowState(child)->OnWMEvent(&event); 129 wm::GetWindowState(child)->OnWMEvent(&event);
132 UpdateShelfVisibility(); 130 UpdateShelfVisibility();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 for (aura::Window* window : windows) { 399 for (aura::Window* window : windows) {
402 wm::WindowState* window_state = wm::GetWindowState(window); 400 wm::WindowState* window_state = wm::GetWindowState(window);
403 if (window_on_top) 401 if (window_on_top)
404 window_state->DisableAlwaysOnTop(window_on_top); 402 window_state->DisableAlwaysOnTop(window_on_top);
405 else 403 else
406 window_state->RestoreAlwaysOnTop(); 404 window_state->RestoreAlwaysOnTop();
407 } 405 }
408 } 406 }
409 407
410 } // namespace ash 408 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698