| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/wm/window_cycle_list.h" | 5 #include "ash/common/wm/window_cycle_list.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // never change). | 381 // never change). |
| 382 mirror_container_->layer()->SetAnimator( | 382 mirror_container_->layer()->SetAnimator( |
| 383 ui::LayerAnimator::CreateImplicitAnimator()); | 383 ui::LayerAnimator::CreateImplicitAnimator()); |
| 384 // The selection highlight also animates all bounds changes and never | 384 // The selection highlight also animates all bounds changes and never |
| 385 // changes other animatable properties. | 385 // changes other animatable properties. |
| 386 highlight_view_->layer()->SetAnimator( | 386 highlight_view_->layer()->SetAnimator( |
| 387 ui::LayerAnimator::CreateImplicitAnimator()); | 387 ui::LayerAnimator::CreateImplicitAnimator()); |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 | 390 |
| 391 void OnMouseCaptureLost() override { |
| 392 WmShell::Get()->window_cycle_controller()->StopCycling(); |
| 393 } |
| 394 |
| 391 View* GetContentsView() override { return this; } | 395 View* GetContentsView() override { return this; } |
| 392 | 396 |
| 393 View* GetInitiallyFocusedView() override { | 397 View* GetInitiallyFocusedView() override { |
| 394 return window_view_map_[target_window_]; | 398 return window_view_map_[target_window_]; |
| 395 } | 399 } |
| 396 | 400 |
| 397 WmWindow* target_window() { return target_window_; } | 401 WmWindow* target_window() { return target_window_; } |
| 398 | 402 |
| 399 private: | 403 private: |
| 400 WindowCycleController::Direction initial_direction_; | 404 WindowCycleController::Direction initial_direction_; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 widget, kShellWindowId_OverlayContainer, ¶ms); | 592 widget, kShellWindowId_OverlayContainer, ¶ms); |
| 589 widget->Init(params); | 593 widget->Init(params); |
| 590 | 594 |
| 591 // TODO(estade): If the display metrics change, cancel the UI. | 595 // TODO(estade): If the display metrics change, cancel the UI. |
| 592 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); | 596 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); |
| 593 int widget_height = cycle_view_->GetPreferredSize().height(); | 597 int widget_height = cycle_view_->GetPreferredSize().height(); |
| 594 widget_rect.set_y((widget_rect.height() - widget_height) / 2); | 598 widget_rect.set_y((widget_rect.height() - widget_height) / 2); |
| 595 widget_rect.set_height(widget_height); | 599 widget_rect.set_height(widget_height); |
| 596 widget->SetBounds(widget_rect); | 600 widget->SetBounds(widget_rect); |
| 597 widget->Show(); | 601 widget->Show(); |
| 602 widget->SetCapture(cycle_view_); |
| 603 widget->set_auto_release_capture(false); |
| 598 cycle_ui_widget_.reset(widget); | 604 cycle_ui_widget_.reset(widget); |
| 599 } | 605 } |
| 600 | 606 |
| 601 } // namespace ash | 607 } // namespace ash |
| OLD | NEW |