| 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();
|
|
|
|
|