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

Unified Diff: ash/wm/workspace_controller.cc

Issue 1841803002: Cleanup WorkspaceController and WorkspaceLayoutManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check if the container is kShellWindowId_DefaultContainer instead. Created 4 years, 8 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/workspace_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace_controller.cc
diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc
index a47772720ef2668bcca22e63888865589f40e00a..5e26080c248ee6947b058c0cc3e1fa5677e798a9 100644
--- a/ash/wm/workspace_controller.cc
+++ b/ash/wm/workspace_controller.cc
@@ -42,18 +42,16 @@ bool IsDockedAreaVisible(const ShelfLayoutManager* shelf) {
WorkspaceController::WorkspaceController(aura::Window* viewport)
: viewport_(viewport),
- shelf_(NULL),
+ shelf_(nullptr),
event_handler_(new WorkspaceEventHandler),
layout_manager_(new WorkspaceLayoutManager(viewport)) {
- SetWindowVisibilityAnimationTransition(
- viewport_, ::wm::ANIMATE_NONE);
-
+ SetWindowVisibilityAnimationTransition(viewport_, ::wm::ANIMATE_NONE);
viewport_->SetLayoutManager(layout_manager_);
viewport_->AddPreTargetHandler(event_handler_.get());
}
WorkspaceController::~WorkspaceController() {
- viewport_->SetLayoutManager(NULL);
+ viewport_->SetLayoutManager(nullptr);
viewport_->RemovePreTargetHandler(event_handler_.get());
}
@@ -70,27 +68,22 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const {
// These are the container ids of containers which may contain windows that
// may overlap the launcher shelf and affect its transparency.
const int kWindowContainerIds[] = {kShellWindowId_DefaultContainer,
- kShellWindowId_DockedContainer, };
+ kShellWindowId_DockedContainer};
const gfx::Rect shelf_bounds(shelf_->GetIdealBounds());
bool window_overlaps_launcher = false;
for (size_t idx = 0; idx < arraysize(kWindowContainerIds); idx++) {
const aura::Window* container = Shell::GetContainer(
viewport_->GetRootWindow(), kWindowContainerIds[idx]);
const aura::Window::Windows& windows(container->children());
- for (aura::Window::Windows::const_iterator i = windows.begin();
- i != windows.end(); ++i) {
- wm::WindowState* window_state = wm::GetWindowState(*i);
+ for (auto* window : windows) {
+ wm::WindowState* window_state = wm::GetWindowState(window);
if (window_state->ignored_by_shelf())
continue;
- ui::Layer* layer = (*i)->layer();
- if (!layer->GetTargetVisibility())
+ if (!window->layer()->GetTargetVisibility())
continue;
if (window_state->IsMaximized())
return WORKSPACE_WINDOW_STATE_MAXIMIZED;
- if (!window_overlaps_launcher &&
- ((*i)->bounds().Intersects(shelf_bounds))) {
- window_overlaps_launcher = true;
- }
+ window_overlaps_launcher |= window->bounds().Intersects(shelf_bounds);
}
}
@@ -99,11 +92,6 @@ WorkspaceWindowState WorkspaceController::GetWindowState() const {
WORKSPACE_WINDOW_STATE_DEFAULT;
}
-void WorkspaceController::SetShelf(ShelfLayoutManager* shelf) {
- shelf_ = shelf;
- layout_manager_->SetShelf(shelf);
-}
-
void WorkspaceController::DoInitialAnimation() {
viewport_->Show();
« no previous file with comments | « ash/wm/workspace_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698