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" |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 476 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
477 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 477 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
478 params.visible_on_all_workspaces = true; | 478 params.visible_on_all_workspaces = true; |
479 params.name = "OverviewModeMinimized"; | 479 params.name = "OverviewModeMinimized"; |
480 params.activatable = views::Widget::InitParams::Activatable::ACTIVATABLE_NO; | 480 params.activatable = views::Widget::InitParams::Activatable::ACTIVATABLE_NO; |
481 params.accept_events = true; | 481 params.accept_events = true; |
482 minimized_widget_.reset(new views::Widget); | 482 minimized_widget_.reset(new views::Widget); |
483 window_->GetRootWindow() | 483 window_->GetRootWindow() |
484 ->GetRootWindowController() | 484 ->GetRootWindowController() |
485 ->ConfigureWidgetInitParamsForContainer( | 485 ->ConfigureWidgetInitParamsForContainer( |
486 minimized_widget_.get(), window_->GetParent()->GetShellWindowId(), | 486 minimized_widget_.get(), window_->GetParent()->aura_window()->id(), |
487 ¶ms); | 487 ¶ms); |
488 minimized_widget_->set_focus_on_creation(false); | 488 minimized_widget_->set_focus_on_creation(false); |
489 minimized_widget_->Init(params); | 489 minimized_widget_->Init(params); |
490 | 490 |
491 views::View* mirror_view = window_->CreateViewWithRecreatedLayers().release(); | 491 views::View* mirror_view = window_->CreateViewWithRecreatedLayers().release(); |
492 mirror_view->SetVisible(true); | 492 mirror_view->SetVisible(true); |
493 mirror_view->SetTargetHandler(this); | 493 mirror_view->SetTargetHandler(this); |
494 minimized_widget_->SetContentsView(mirror_view); | 494 minimized_widget_->SetContentsView(mirror_view); |
495 gfx::Rect bounds(window_->GetBoundsInScreen()); | 495 gfx::Rect bounds(window_->GetBoundsInScreen()); |
496 gfx::Size preferred = mirror_view->GetPreferredSize(); | 496 gfx::Size preferred = mirror_view->GetPreferredSize(); |
497 // In unit tests, the content view can have empty size. | 497 // In unit tests, the content view can have empty size. |
498 if (!preferred.IsEmpty()) { | 498 if (!preferred.IsEmpty()) { |
499 int inset = bounds.height() - preferred.height(); | 499 int inset = bounds.height() - preferred.height(); |
500 bounds.Inset(0, 0, 0, inset); | 500 bounds.Inset(0, 0, 0, inset); |
501 } | 501 } |
502 minimized_widget_->SetBounds(bounds); | 502 minimized_widget_->SetBounds(bounds); |
503 minimized_widget_->Show(); | 503 minimized_widget_->Show(); |
504 } | 504 } |
505 | 505 |
506 } // namespace ash | 506 } // namespace ash |
OLD | NEW |