| 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/wm/mru_window_tracker.h" | 10 #include "ash/common/wm/mru_window_tracker.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 views::View* highlight_view_; | 377 views::View* highlight_view_; |
| 378 WmWindow* target_window_; | 378 WmWindow* target_window_; |
| 379 | 379 |
| 380 DISALLOW_COPY_AND_ASSIGN(WindowCycleView); | 380 DISALLOW_COPY_AND_ASSIGN(WindowCycleView); |
| 381 }; | 381 }; |
| 382 | 382 |
| 383 WindowCycleList::WindowCycleList(const WindowList& windows) | 383 WindowCycleList::WindowCycleList(const WindowList& windows) |
| 384 : windows_(windows), | 384 : windows_(windows), |
| 385 screen_observer_(this) { | 385 screen_observer_(this) { |
| 386 if (!ShouldShowUi()) | 386 if (!ShouldShowUi()) |
| 387 WmShell::Get()->mru_window_tracker()->SetIgnoreActivations(true); | 387 Shell::Get()->mru_window_tracker()->SetIgnoreActivations(true); |
| 388 | 388 |
| 389 for (WmWindow* window : windows_) | 389 for (WmWindow* window : windows_) |
| 390 window->aura_window()->AddObserver(this); | 390 window->aura_window()->AddObserver(this); |
| 391 | 391 |
| 392 if (ShouldShowUi()) { | 392 if (ShouldShowUi()) { |
| 393 if (g_disable_initial_delay) { | 393 if (g_disable_initial_delay) { |
| 394 InitWindowCycleView(); | 394 InitWindowCycleView(); |
| 395 } else { | 395 } else { |
| 396 show_ui_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(150), | 396 show_ui_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(150), |
| 397 this, &WindowCycleList::InitWindowCycleView); | 397 this, &WindowCycleList::InitWindowCycleView); |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 WindowCycleList::~WindowCycleList() { | 402 WindowCycleList::~WindowCycleList() { |
| 403 if (!ShouldShowUi()) | 403 if (!ShouldShowUi()) |
| 404 WmShell::Get()->mru_window_tracker()->SetIgnoreActivations(false); | 404 Shell::Get()->mru_window_tracker()->SetIgnoreActivations(false); |
| 405 | 405 |
| 406 for (WmWindow* window : windows_) | 406 for (WmWindow* window : windows_) |
| 407 window->aura_window()->RemoveObserver(this); | 407 window->aura_window()->RemoveObserver(this); |
| 408 | 408 |
| 409 if (!windows_.empty() && user_did_accept_) { | 409 if (!windows_.empty() && user_did_accept_) { |
| 410 WmWindow* target_window = windows_[current_index_]; | 410 WmWindow* target_window = windows_[current_index_]; |
| 411 target_window->Show(); | 411 target_window->Show(); |
| 412 target_window->GetWindowState()->Activate(); | 412 target_window->GetWindowState()->Activate(); |
| 413 } | 413 } |
| 414 | 414 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 widget_rect.set_height(widget_height); | 543 widget_rect.set_height(widget_height); |
| 544 params.bounds = widget_rect; | 544 params.bounds = widget_rect; |
| 545 widget->Init(params); | 545 widget->Init(params); |
| 546 | 546 |
| 547 screen_observer_.Add(display::Screen::GetScreen()); | 547 screen_observer_.Add(display::Screen::GetScreen()); |
| 548 widget->Show(); | 548 widget->Show(); |
| 549 cycle_ui_widget_ = widget; | 549 cycle_ui_widget_ = widget; |
| 550 } | 550 } |
| 551 | 551 |
| 552 } // namespace ash | 552 } // namespace ash |
| OLD | NEW |