| 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/wm/overview/scoped_transform_overview_window.h" | 5 #include "ash/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/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/wm/overview/scoped_overview_animation_settings.h" | 11 #include "ash/wm/overview/scoped_overview_animation_settings.h" |
| 12 #include "ash/wm/overview/scoped_overview_animation_settings_factory.h" | 12 #include "ash/wm/overview/scoped_overview_animation_settings_factory.h" |
| 13 #include "ash/wm/overview/window_selector_item.h" | 13 #include "ash/wm/overview/window_selector_item.h" |
| 14 #include "ash/wm/window_mirror_view.h" |
| 14 #include "ash/wm/window_state.h" | 15 #include "ash/wm/window_state.h" |
| 15 #include "ash/wm_window.h" | 16 #include "ash/wm_window.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 18 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "ui/aura/client/aura_constants.h" | 21 #include "ui/aura/client/aura_constants.h" |
| 21 #include "ui/compositor/layer.h" | 22 #include "ui/compositor/layer.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
| 23 #include "ui/gfx/geometry/safe_integer_conversions.h" | 24 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 params.accept_events = true; | 482 params.accept_events = true; |
| 482 minimized_widget_.reset(new views::Widget); | 483 minimized_widget_.reset(new views::Widget); |
| 483 window_->GetRootWindow() | 484 window_->GetRootWindow() |
| 484 ->GetRootWindowController() | 485 ->GetRootWindowController() |
| 485 ->ConfigureWidgetInitParamsForContainer( | 486 ->ConfigureWidgetInitParamsForContainer( |
| 486 minimized_widget_.get(), window_->GetParent()->aura_window()->id(), | 487 minimized_widget_.get(), window_->GetParent()->aura_window()->id(), |
| 487 ¶ms); | 488 ¶ms); |
| 488 minimized_widget_->set_focus_on_creation(false); | 489 minimized_widget_->set_focus_on_creation(false); |
| 489 minimized_widget_->Init(params); | 490 minimized_widget_->Init(params); |
| 490 | 491 |
| 491 views::View* mirror_view = window_->CreateViewWithRecreatedLayers().release(); | 492 views::View* mirror_view = new wm::WindowMirrorView(window_->aura_window()); |
| 492 mirror_view->SetVisible(true); | 493 mirror_view->SetVisible(true); |
| 493 mirror_view->SetTargetHandler(this); | 494 mirror_view->SetTargetHandler(this); |
| 494 minimized_widget_->SetContentsView(mirror_view); | 495 minimized_widget_->SetContentsView(mirror_view); |
| 495 gfx::Rect bounds(window_->GetBoundsInScreen()); | 496 gfx::Rect bounds(window_->GetBoundsInScreen()); |
| 496 gfx::Size preferred = mirror_view->GetPreferredSize(); | 497 gfx::Size preferred = mirror_view->GetPreferredSize(); |
| 497 // In unit tests, the content view can have empty size. | 498 // In unit tests, the content view can have empty size. |
| 498 if (!preferred.IsEmpty()) { | 499 if (!preferred.IsEmpty()) { |
| 499 int inset = bounds.height() - preferred.height(); | 500 int inset = bounds.height() - preferred.height(); |
| 500 bounds.Inset(0, 0, 0, inset); | 501 bounds.Inset(0, 0, 0, inset); |
| 501 } | 502 } |
| 502 minimized_widget_->SetBounds(bounds); | 503 minimized_widget_->SetBounds(bounds); |
| 503 minimized_widget_->Show(); | 504 minimized_widget_->Show(); |
| 504 } | 505 } |
| 505 | 506 |
| 506 } // namespace ash | 507 } // namespace ash |
| OLD | NEW |