| 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 params.delegate = cycle_view_; | 606 params.delegate = cycle_view_; |
| 607 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 607 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
| 608 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 608 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 609 params.accept_events = true; | 609 params.accept_events = true; |
| 610 params.name = "WindowCycleList (Alt+Tab)"; | 610 params.name = "WindowCycleList (Alt+Tab)"; |
| 611 // TODO(estade): make sure nothing untoward happens when the lock screen | 611 // TODO(estade): make sure nothing untoward happens when the lock screen |
| 612 // or a system modal dialog is shown. | 612 // or a system modal dialog is shown. |
| 613 WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows(); | 613 WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows(); |
| 614 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( | 614 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( |
| 615 widget, kShellWindowId_OverlayContainer, ¶ms); | 615 widget, kShellWindowId_OverlayContainer, ¶ms); |
| 616 widget->Init(params); | |
| 617 | |
| 618 screen_observer_.Add(display::Screen::GetScreen()); | |
| 619 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); | 616 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); |
| 620 int widget_height = cycle_view_->GetPreferredSize().height(); | 617 int widget_height = cycle_view_->GetPreferredSize().height(); |
| 621 widget_rect.set_y((widget_rect.height() - widget_height) / 2); | 618 widget_rect.set_y((widget_rect.height() - widget_height) / 2); |
| 622 widget_rect.set_height(widget_height); | 619 widget_rect.set_height(widget_height); |
| 623 widget->SetBounds(widget_rect); | 620 params.bounds = widget_rect; |
| 621 widget->Init(params); |
| 622 |
| 623 screen_observer_.Add(display::Screen::GetScreen()); |
| 624 widget->Show(); | 624 widget->Show(); |
| 625 widget->SetCapture(cycle_view_); | 625 widget->SetCapture(cycle_view_); |
| 626 widget->set_auto_release_capture(false); | 626 widget->set_auto_release_capture(false); |
| 627 cycle_ui_widget_ = widget; | 627 cycle_ui_widget_ = widget; |
| 628 } | 628 } |
| 629 | 629 |
| 630 } // namespace ash | 630 } // namespace ash |
| OLD | NEW |