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

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

Issue 2899253002: chromeos: Rename ash::WmShelf to Shelf (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 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"
11 #include "ash/shelf/wm_shelf.h" 11 #include "ash/shelf/shelf.h"
12 #include "ash/shell_port.h" 12 #include "ash/shell_port.h"
13 #include "ash/wm/fullscreen_window_finder.h" 13 #include "ash/wm/fullscreen_window_finder.h"
14 #include "ash/wm/window_state.h" 14 #include "ash/wm/window_state.h"
15 #include "ash/wm/wm_window_animations.h" 15 #include "ash/wm/wm_window_animations.h"
16 #include "ash/wm/workspace/backdrop_controller.h" 16 #include "ash/wm/workspace/backdrop_controller.h"
17 #include "ash/wm/workspace/backdrop_delegate.h" 17 #include "ash/wm/workspace/backdrop_delegate.h"
18 #include "ash/wm/workspace/workspace_event_handler.h" 18 #include "ash/wm/workspace/workspace_event_handler.h"
19 #include "ash/wm/workspace/workspace_layout_manager.h" 19 #include "ash/wm/workspace/workspace_layout_manager.h"
20 #include "ash/wm_window.h" 20 #include "ash/wm_window.h"
21 #include "ui/aura/window.h" 21 #include "ui/aura/window.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const { 55 wm::WorkspaceWindowState WorkspaceController::GetWindowState() const {
56 if (!viewport_) 56 if (!viewport_)
57 return wm::WORKSPACE_WINDOW_STATE_DEFAULT; 57 return wm::WORKSPACE_WINDOW_STATE_DEFAULT;
58 58
59 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_); 59 const aura::Window* fullscreen = wm::GetWindowForFullscreenMode(viewport_);
60 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf()) 60 if (fullscreen && !wm::GetWindowState(fullscreen)->ignored_by_shelf())
61 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN; 61 return wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN;
62 62
63 const gfx::Rect shelf_bounds(WmShelf::ForWindow(viewport_)->GetIdealBounds()); 63 const gfx::Rect shelf_bounds(Shelf::ForWindow(viewport_)->GetIdealBounds());
64 bool window_overlaps_launcher = false; 64 bool window_overlaps_launcher = false;
65 // The default container may contain windows that may overlap the launcher 65 // The default container may contain windows that may overlap the launcher
66 // shelf and affect its transparency. 66 // shelf and affect its transparency.
67 aura::Window* container = 67 aura::Window* container =
68 viewport_->GetRootWindow()->GetChildById(kShellWindowId_DefaultContainer); 68 viewport_->GetRootWindow()->GetChildById(kShellWindowId_DefaultContainer);
69 for (aura::Window* window : container->children()) { 69 for (aura::Window* window : container->children()) {
70 wm::WindowState* window_state = wm::GetWindowState(window); 70 wm::WindowState* window_state = wm::GetWindowState(window);
71 if (window_state->ignored_by_shelf() || 71 if (window_state->ignored_by_shelf() ||
72 (window->layer() && !window->layer()->GetTargetVisibility())) { 72 (window->layer() && !window->layer()->GetTargetVisibility())) {
73 continue; 73 continue;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 void WorkspaceController::OnWindowDestroying(aura::Window* window) { 118 void WorkspaceController::OnWindowDestroying(aura::Window* window) {
119 DCHECK_EQ(window, viewport_); 119 DCHECK_EQ(window, viewport_);
120 viewport_->RemoveObserver(this); 120 viewport_->RemoveObserver(this);
121 viewport_ = nullptr; 121 viewport_ = nullptr;
122 // Destroy |event_handler_| too as it depends upon |window|. 122 // Destroy |event_handler_| too as it depends upon |window|.
123 event_handler_.reset(); 123 event_handler_.reset();
124 layout_manager_ = nullptr; 124 layout_manager_ = nullptr;
125 } 125 }
126 126
127 } // namespace ash 127 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698