| 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 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "base/strings/stringprintf.h" | 31 #include "base/strings/stringprintf.h" |
| 32 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
| 33 #include "ui/aura/client/capture_client.h" | 33 #include "ui/aura/client/capture_client.h" |
| 34 #include "ui/aura/client/focus_client.h" | 34 #include "ui/aura/client/focus_client.h" |
| 35 #include "ui/aura/client/screen_position_client.h" | 35 #include "ui/aura/client/screen_position_client.h" |
| 36 #include "ui/aura/window.h" | 36 #include "ui/aura/window.h" |
| 37 #include "ui/aura/window_event_dispatcher.h" | 37 #include "ui/aura/window_event_dispatcher.h" |
| 38 #include "ui/aura/window_property.h" | 38 #include "ui/aura/window_property.h" |
| 39 #include "ui/aura/window_tracker.h" | 39 #include "ui/aura/window_tracker.h" |
| 40 #include "ui/aura/window_tree_host.h" | 40 #include "ui/aura/window_tree_host.h" |
| 41 #include "ui/base/ime/input_method_factory.h" |
| 41 #include "ui/compositor/compositor.h" | 42 #include "ui/compositor/compositor.h" |
| 42 #include "ui/gfx/display.h" | 43 #include "ui/gfx/display.h" |
| 43 #include "ui/gfx/screen.h" | 44 #include "ui/gfx/screen.h" |
| 44 #include "ui/wm/core/coordinate_conversion.h" | 45 #include "ui/wm/core/coordinate_conversion.h" |
| 45 #include "ui/wm/public/activation_client.h" | 46 #include "ui/wm/public/activation_client.h" |
| 46 | 47 |
| 47 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 48 #include "ash/display/display_configurator_animation.h" | 49 #include "ash/display/display_configurator_animation.h" |
| 49 #include "base/sys_info.h" | 50 #include "base/sys_info.h" |
| 50 #include "base/time/time.h" | 51 #include "base/time/time.h" |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 const AshWindowTreeHostInitParams& init_params) { | 873 const AshWindowTreeHostInitParams& init_params) { |
| 873 static int host_count = 0; | 874 static int host_count = 0; |
| 874 const DisplayInfo& display_info = | 875 const DisplayInfo& display_info = |
| 875 GetDisplayManager()->GetDisplayInfo(display.id()); | 876 GetDisplayManager()->GetDisplayInfo(display.id()); |
| 876 AshWindowTreeHostInitParams params_with_bounds(init_params); | 877 AshWindowTreeHostInitParams params_with_bounds(init_params); |
| 877 params_with_bounds.initial_bounds = display_info.bounds_in_native(); | 878 params_with_bounds.initial_bounds = display_info.bounds_in_native(); |
| 878 params_with_bounds.offscreen = | 879 params_with_bounds.offscreen = |
| 879 display.id() == DisplayManager::kUnifiedDisplayId; | 880 display.id() == DisplayManager::kUnifiedDisplayId; |
| 880 AshWindowTreeHost* ash_host = AshWindowTreeHost::Create(params_with_bounds); | 881 AshWindowTreeHost* ash_host = AshWindowTreeHost::Create(params_with_bounds); |
| 881 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); | 882 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); |
| 883 if (!input_method_) { // Singleton input method instance for Ash. |
| 884 input_method_ = ui::CreateInputMethod(host, host->GetAcceleratedWidget()); |
| 885 input_method_->OnFocus(); |
| 886 } |
| 887 host->SetInputMethod(input_method_.get()); |
| 882 | 888 |
| 883 host->window()->SetName(base::StringPrintf( | 889 host->window()->SetName(base::StringPrintf( |
| 884 "%sRootWindow-%d", params_with_bounds.offscreen ? "Offscreen" : "", | 890 "%sRootWindow-%d", params_with_bounds.offscreen ? "Offscreen" : "", |
| 885 host_count++)); | 891 host_count++)); |
| 886 host->window()->SetTitle(base::UTF8ToUTF16(display_info.name())); | 892 host->window()->SetTitle(base::UTF8ToUTF16(display_info.name())); |
| 887 host->compositor()->SetBackgroundColor(SK_ColorBLACK); | 893 host->compositor()->SetBackgroundColor(SK_ColorBLACK); |
| 888 // No need to remove our observer observer because the DisplayController | 894 // No need to remove our observer observer because the DisplayController |
| 889 // outlives the host. | 895 // outlives the host. |
| 890 host->AddObserver(this); | 896 host->AddObserver(this); |
| 891 InitRootWindowSettings(host->window())->display_id = display.id(); | 897 InitRootWindowSettings(host->window())->display_id = display.id(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 907 Shell::GetInstance()->display_configurator_animation() | 913 Shell::GetInstance()->display_configurator_animation() |
| 908 ->StartFadeInAnimation(); | 914 ->StartFadeInAnimation(); |
| 909 #endif | 915 #endif |
| 910 } | 916 } |
| 911 | 917 |
| 912 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { | 918 void DisplayController::SetMirrorModeAfterAnimation(bool mirror) { |
| 913 GetDisplayManager()->SetMirrorMode(mirror); | 919 GetDisplayManager()->SetMirrorMode(mirror); |
| 914 } | 920 } |
| 915 | 921 |
| 916 } // namespace ash | 922 } // namespace ash |
| OLD | NEW |