| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 } | 377 } |
| 378 | 378 |
| 379 WindowCycleList::WindowCycleList(const WindowList& windows) | 379 WindowCycleList::WindowCycleList(const WindowList& windows) |
| 380 : windows_(windows), current_index_(0), cycle_view_(nullptr) { | 380 : windows_(windows), current_index_(0), cycle_view_(nullptr) { |
| 381 WmShell::Get()->mru_window_tracker()->SetIgnoreActivations(true); | 381 WmShell::Get()->mru_window_tracker()->SetIgnoreActivations(true); |
| 382 | 382 |
| 383 for (WmWindow* window : windows_) | 383 for (WmWindow* window : windows_) |
| 384 window->AddObserver(this); | 384 window->AddObserver(this); |
| 385 | 385 |
| 386 if (ShouldShowUi()) { | 386 if (ShouldShowUi()) { |
| 387 WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows(); | 387 WmWindow* root_window = WmShell::Get()->root_window_for_new_windows(); |
| 388 views::Widget* widget = new views::Widget; | 388 views::Widget* widget = new views::Widget; |
| 389 views::Widget::InitParams params; | 389 views::Widget::InitParams params; |
| 390 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; | 390 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; |
| 391 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 391 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 392 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 392 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 393 params.accept_events = true; | 393 params.accept_events = true; |
| 394 // TODO(estade): make sure nothing untoward happens when the lock screen | 394 // TODO(estade): make sure nothing untoward happens when the lock screen |
| 395 // or a system modal dialog is shown. | 395 // or a system modal dialog is shown. |
| 396 root_window->GetRootWindowController() | 396 root_window->GetRootWindowController() |
| 397 ->ConfigureWidgetInitParamsForContainer( | 397 ->ConfigureWidgetInitParamsForContainer( |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 } | 485 } |
| 486 } | 486 } |
| 487 | 487 |
| 488 bool WindowCycleList::ShouldShowUi() { | 488 bool WindowCycleList::ShouldShowUi() { |
| 489 return windows_.size() > 1 && | 489 return windows_.size() > 1 && |
| 490 base::CommandLine::ForCurrentProcess()->HasSwitch( | 490 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 491 switches::kAshEnableWindowCycleUi); | 491 switches::kAshEnableWindowCycleUi); |
| 492 } | 492 } |
| 493 | 493 |
| 494 } // namespace ash | 494 } // namespace ash |
| OLD | NEW |