| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
| 12 #include "ash/display/cursor_window_controller.h" | 12 #include "ash/display/cursor_window_controller.h" |
| 13 #include "ash/display/display_layout_store.h" | 13 #include "ash/display/display_layout_store.h" |
| 14 #include "ash/display/display_manager.h" | 14 #include "ash/display/display_manager.h" |
| 15 #include "ash/display/mirror_window_controller.h" | 15 #include "ash/display/mirror_window_controller.h" |
| 16 #include "ash/display/root_window_transformers.h" | 16 #include "ash/display/root_window_transformers.h" |
| 17 #include "ash/host/ash_window_tree_host.h" | 17 #include "ash/host/ash_window_tree_host.h" |
| 18 #include "ash/host/ash_window_tree_host_init_params.h" | 18 #include "ash/host/ash_window_tree_host_init_params.h" |
| 19 #include "ash/host/root_window_transformer.h" | 19 #include "ash/host/root_window_transformer.h" |
| 20 #include "ash/root_window_controller.h" | 20 #include "ash/root_window_controller.h" |
| 21 #include "ash/root_window_settings.h" | 21 #include "ash/root_window_settings.h" |
| 22 #include "ash/screen_util.h" | 22 #include "ash/screen_util.h" |
| 23 #include "ash/shell.h" | 23 #include "ash/shell.h" |
| 24 #include "ash/shell_delegate.h" | 24 #include "ash/shell_delegate.h" |
| 25 #include "ash/system/tray/system_tray.h" |
| 25 #include "ash/wm/coordinate_conversion.h" | 26 #include "ash/wm/coordinate_conversion.h" |
| 26 #include "base/command_line.h" | 27 #include "base/command_line.h" |
| 27 #include "base/stl_util.h" | 28 #include "base/stl_util.h" |
| 28 #include "base/strings/stringprintf.h" | 29 #include "base/strings/stringprintf.h" |
| 29 #include "base/strings/utf_string_conversions.h" | 30 #include "base/strings/utf_string_conversions.h" |
| 30 #include "ui/aura/client/capture_client.h" | 31 #include "ui/aura/client/capture_client.h" |
| 31 #include "ui/aura/client/focus_client.h" | 32 #include "ui/aura/client/focus_client.h" |
| 32 #include "ui/aura/client/screen_position_client.h" | 33 #include "ui/aura/client/screen_position_client.h" |
| 33 #include "ui/aura/window.h" | 34 #include "ui/aura/window.h" |
| 34 #include "ui/aura/window_event_dispatcher.h" | 35 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 DisplayManager::UNIFIED) { | 637 DisplayManager::UNIFIED) { |
| 637 if (primary_display_id == gfx::Display::kInvalidDisplayID) | 638 if (primary_display_id == gfx::Display::kInvalidDisplayID) |
| 638 primary_display_id = display.id(); | 639 primary_display_id = display.id(); |
| 639 AshWindowTreeHost* ash_host = | 640 AshWindowTreeHost* ash_host = |
| 640 AddWindowTreeHostForDisplay(display, AshWindowTreeHostInitParams()); | 641 AddWindowTreeHostForDisplay(display, AshWindowTreeHostInitParams()); |
| 641 RootWindowController::CreateForSecondaryDisplay(ash_host); | 642 RootWindowController::CreateForSecondaryDisplay(ash_host); |
| 642 | 643 |
| 643 if (primary_tree_host_for_replace_) { | 644 if (primary_tree_host_for_replace_) { |
| 644 AshWindowTreeHost* to_delete = primary_tree_host_for_replace_; | 645 AshWindowTreeHost* to_delete = primary_tree_host_for_replace_; |
| 645 primary_tree_host_for_replace_ = nullptr; | 646 primary_tree_host_for_replace_ = nullptr; |
| 647 |
| 648 // Show the shelf if the original WTH had a visible system |
| 649 // tray. It may or may not be visible depending on OOBE state. |
| 650 ash::SystemTray* old_tray = |
| 651 GetRootWindowController(to_delete->AsWindowTreeHost()->window()) |
| 652 ->GetSystemTray(); |
| 653 ash::SystemTray* new_tray = |
| 654 ash::Shell::GetInstance()->GetPrimarySystemTray(); |
| 655 if (old_tray->GetWidget()->IsVisible()) { |
| 656 new_tray->SetVisible(true); |
| 657 new_tray->GetWidget()->Show(); |
| 658 } |
| 659 |
| 646 DeleteHost(to_delete); | 660 DeleteHost(to_delete); |
| 647 #ifndef NDEBUG | 661 #ifndef NDEBUG |
| 648 auto iter = std::find_if( | 662 auto iter = std::find_if( |
| 649 window_tree_hosts_.begin(), window_tree_hosts_.end(), | 663 window_tree_hosts_.begin(), window_tree_hosts_.end(), |
| 650 [to_delete](const std::pair<int64, AshWindowTreeHost*>& pair) { | 664 [to_delete](const std::pair<int64, AshWindowTreeHost*>& pair) { |
| 651 return pair.second == to_delete; | 665 return pair.second == to_delete; |
| 652 }); | 666 }); |
| 653 DCHECK(iter == window_tree_hosts_.end()); | 667 DCHECK(iter == window_tree_hosts_.end()); |
| 654 #endif | 668 #endif |
| 655 // the host has already been removed from the window_tree_host_. | 669 // the host has already been removed from the window_tree_host_. |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 Shell::GetInstance()->display_configurator_animation() | 887 Shell::GetInstance()->display_configurator_animation() |
| 874 ->StartFadeInAnimation(); | 888 ->StartFadeInAnimation(); |
| 875 #endif | 889 #endif |
| 876 } | 890 } |
| 877 | 891 |
| 878 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { | 892 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { |
| 879 GetDisplayManager()->SetMirrorMode(mirror); | 893 GetDisplayManager()->SetMirrorMode(mirror); |
| 880 } | 894 } |
| 881 | 895 |
| 882 } // namespace ash | 896 } // namespace ash |
| OLD | NEW |