Chromium Code Reviews| Index: ash/wm/workspace_controller.cc |
| diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc |
| index bea54a92fc346d5a5d8bc9612dad011b8f0bf7cc..db4f23789fb54e8e65ca3063b9ba4a8cf80b7298 100644 |
| --- a/ash/wm/workspace_controller.cc |
| +++ b/ash/wm/workspace_controller.cc |
| @@ -42,7 +42,7 @@ 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( |
| @@ -53,7 +53,7 @@ WorkspaceController::WorkspaceController(aura::Window* viewport) |
| } |
| WorkspaceController::~WorkspaceController() { |
| - viewport_->SetLayoutManager(NULL); |
| + viewport_->SetLayoutManager(nullptr); |
| viewport_->RemovePreTargetHandler(event_handler_.get()); |
| } |
| @@ -70,27 +70,23 @@ 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) { |
|
oshima
2016/03/29 22:42:25
nit: auto*
msw
2016/03/29 22:48:00
Done.
|
| + 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 +95,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(); |