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

Side by Side Diff: ash/wm/workspace_controller.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Sync and rebase. 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_controller.h" 5 #include "ash/wm/workspace_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { 56 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const {
57 if (!viewport_ || !RootWindowController::ForWindow(viewport_)->HasShelf()) 57 if (!viewport_ || !RootWindowController::ForWindow(viewport_)->HasShelf())
58 return wm::WORKSPACE_WINDOW_STATE_DEFAULT; 58 return wm::WORKSPACE_WINDOW_STATE_DEFAULT;
59 59
60 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_); 60 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_);
61 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf()) 61 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf())
62 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; 62 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN;
63 63
64 const gfx::Rect shelf_bounds( 64 const gfx::Rect shelf_bounds(WmShelf::ForWindow(viewport_)->GetIdealBounds());
65 WmShelf::ForWindow(WmWindow::Get(viewport_))->GetIdealBounds());
66 bool window_overlaps_launcher = false; 65 bool window_overlaps_launcher = false;
67 // The default container may contain windows that may overlap the launcher 66 // The default container may contain windows that may overlap the launcher
68 // shelf and affect its transparency. 67 // shelf and affect its transparency.
69 aura::Window* container = 68 aura::Window* container =
70 viewport_->GetRootWindow()->GetChildById(kShellWindowId_DefaultContainer); 69 viewport_->GetRootWindow()->GetChildById(kShellWindowId_DefaultContainer);
71 for (aura::Window* window : container->children()) { 70 for (aura::Window* window : container->children()) {
72 wm::WindowState* window_state = wm::GetWindowState(window); 71 wm::WindowState* window_state = wm::GetWindowState(window);
73 if (window_state->ignored_by_shelf() || 72 if (window_state->ignored_by_shelf() ||
74 (window->layer() && !window->layer()->GetTargetVisibility())) { 73 (window->layer() && !window->layer()->GetTargetVisibility())) {
75 continue; 74 continue;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 void WorkspaceController::OnWindowDestroying(aura::Window* window) { 119 void WorkspaceController::OnWindowDestroying(aura::Window* window) {
121 DCHECK_EQ(window, viewport_); 120 DCHECK_EQ(window, viewport_);
122 viewport_->RemoveObserver(this); 121 viewport_->RemoveObserver(this);
123 viewport_ = nullptr; 122 viewport_ = nullptr;
124 // Destroy |event_handler_| too as it depends upon |window|. 123 // Destroy |event_handler_| too as it depends upon |window|.
125 event_handler_.reset(); 124 event_handler_.reset();
126 layout_manager_ = nullptr; 125 layout_manager_ = nullptr;
127 } 126 }
128 127
129 } // namespace ash 128 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698