| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/overview/scoped_transform_overview_window.h" | 5 #include "ash/common/wm/overview/scoped_transform_overview_window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/wm/overview/scoped_overview_animation_settings.h" | 10 #include "ash/common/wm/overview/scoped_overview_animation_settings.h" |
| 11 #include "ash/common/wm/overview/scoped_overview_animation_settings_factory.h" | 11 #include "ash/common/wm/overview/scoped_overview_animation_settings_factory.h" |
| 12 #include "ash/common/wm/overview/window_selector_item.h" | 12 #include "ash/common/wm/overview/window_selector_item.h" |
| 13 #include "ash/common/wm/window_state.h" | 13 #include "ash/common/wm/window_state.h" |
| 14 #include "ash/common/wm_lookup.h" | |
| 15 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 16 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 17 #include "ash/common/wm_window_property.h" | 16 #include "ash/common/wm_window_property.h" |
| 18 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 19 #include "base/macros.h" | 18 #include "base/macros.h" |
| 20 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 21 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 22 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 23 #include "ui/compositor/layer.h" | 22 #include "ui/compositor/layer.h" |
| 24 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 void ScopedTransformOverviewWindow::OnMouseEvent(ui::MouseEvent* event) { | 460 void ScopedTransformOverviewWindow::OnMouseEvent(ui::MouseEvent* event) { |
| 462 if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton()) { | 461 if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton()) { |
| 463 EnsureVisible(); | 462 EnsureVisible(); |
| 464 window_->Show(); | 463 window_->Show(); |
| 465 window_->Activate(); | 464 window_->Activate(); |
| 466 } | 465 } |
| 467 } | 466 } |
| 468 | 467 |
| 469 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindowForMinimizedState() | 468 WmWindow* ScopedTransformOverviewWindow::GetOverviewWindowForMinimizedState() |
| 470 const { | 469 const { |
| 471 return minimized_widget_ | 470 return minimized_widget_ ? WmWindow::Get(minimized_widget_->GetNativeWindow()) |
| 472 ? WmLookup::Get()->GetWindowForWidget(minimized_widget_.get()) | 471 : nullptr; |
| 473 : nullptr; | |
| 474 } | 472 } |
| 475 | 473 |
| 476 void ScopedTransformOverviewWindow::CreateMirrorWindowForMinimizedState() { | 474 void ScopedTransformOverviewWindow::CreateMirrorWindowForMinimizedState() { |
| 477 DCHECK(!minimized_widget_.get()); | 475 DCHECK(!minimized_widget_.get()); |
| 478 views::Widget::InitParams params; | 476 views::Widget::InitParams params; |
| 479 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 477 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
| 480 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 478 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 481 params.visible_on_all_workspaces = true; | 479 params.visible_on_all_workspaces = true; |
| 482 params.name = "OverviewModeMinimized"; | 480 params.name = "OverviewModeMinimized"; |
| 483 params.activatable = views::Widget::InitParams::Activatable::ACTIVATABLE_NO; | 481 params.activatable = views::Widget::InitParams::Activatable::ACTIVATABLE_NO; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 500 // In unit tests, the content view can have empty size. | 498 // In unit tests, the content view can have empty size. |
| 501 if (!preferred.IsEmpty()) { | 499 if (!preferred.IsEmpty()) { |
| 502 int inset = bounds.height() - preferred.height(); | 500 int inset = bounds.height() - preferred.height(); |
| 503 bounds.Inset(0, 0, 0, inset); | 501 bounds.Inset(0, 0, 0, inset); |
| 504 } | 502 } |
| 505 minimized_widget_->SetBounds(bounds); | 503 minimized_widget_->SetBounds(bounds); |
| 506 minimized_widget_->Show(); | 504 minimized_widget_->Show(); |
| 507 } | 505 } |
| 508 | 506 |
| 509 } // namespace ash | 507 } // namespace ash |
| OLD | NEW |