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/wm/window_cycle_list.h" | 5 #include "ash/wm/window_cycle_list.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 views::Widget* widget = new views::Widget; | 526 views::Widget* widget = new views::Widget; |
527 views::Widget::InitParams params; | 527 views::Widget::InitParams params; |
528 params.delegate = cycle_view_; | 528 params.delegate = cycle_view_; |
529 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 529 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
530 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 530 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
531 params.accept_events = true; | 531 params.accept_events = true; |
532 params.name = "WindowCycleList (Alt+Tab)"; | 532 params.name = "WindowCycleList (Alt+Tab)"; |
533 // TODO(estade): make sure nothing untoward happens when the lock screen | 533 // TODO(estade): make sure nothing untoward happens when the lock screen |
534 // or a system modal dialog is shown. | 534 // or a system modal dialog is shown. |
535 WmWindow* root_window = Shell::GetWmRootWindowForNewWindows(); | 535 aura::Window* root_window = Shell::GetRootWindowForNewWindows(); |
536 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( | 536 GetRootWindowController(root_window) |
537 widget, kShellWindowId_OverlayContainer, ¶ms); | 537 ->ConfigureWidgetInitParamsForContainer( |
538 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); | 538 widget, kShellWindowId_OverlayContainer, ¶ms); |
| 539 gfx::Rect widget_rect = display::Screen::GetScreen() |
| 540 ->GetDisplayNearestWindow(root_window) |
| 541 .bounds(); |
539 const int widget_height = cycle_view_->GetPreferredSize().height(); | 542 const int widget_height = cycle_view_->GetPreferredSize().height(); |
540 widget_rect.set_y(widget_rect.y() + | 543 widget_rect.set_y(widget_rect.y() + |
541 (widget_rect.height() - widget_height) / 2); | 544 (widget_rect.height() - widget_height) / 2); |
542 widget_rect.set_height(widget_height); | 545 widget_rect.set_height(widget_height); |
543 params.bounds = widget_rect; | 546 params.bounds = widget_rect; |
544 widget->Init(params); | 547 widget->Init(params); |
545 | 548 |
546 screen_observer_.Add(display::Screen::GetScreen()); | 549 screen_observer_.Add(display::Screen::GetScreen()); |
547 widget->Show(); | 550 widget->Show(); |
548 cycle_ui_widget_ = widget; | 551 cycle_ui_widget_ = widget; |
549 } | 552 } |
550 | 553 |
551 } // namespace ash | 554 } // namespace ash |
OLD | NEW |