| 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/window_tree_host_manager.h" | 5 #include "ash/display/window_tree_host_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 params_with_bounds.offscreen = | 817 params_with_bounds.offscreen = |
| 818 display.id() == display::DisplayManager::kUnifiedDisplayId; | 818 display.id() == display::DisplayManager::kUnifiedDisplayId; |
| 819 params_with_bounds.display_id = display.id(); | 819 params_with_bounds.display_id = display.id(); |
| 820 params_with_bounds.device_scale_factor = display.device_scale_factor(); | 820 params_with_bounds.device_scale_factor = display.device_scale_factor(); |
| 821 params_with_bounds.ui_scale_factor = display_info.configured_ui_scale(); | 821 params_with_bounds.ui_scale_factor = display_info.configured_ui_scale(); |
| 822 // The AshWindowTreeHost ends up owned by the RootWindowControllers created | 822 // The AshWindowTreeHost ends up owned by the RootWindowControllers created |
| 823 // by this class. | 823 // by this class. |
| 824 AshWindowTreeHost* ash_host = | 824 AshWindowTreeHost* ash_host = |
| 825 AshWindowTreeHost::Create(params_with_bounds).release(); | 825 AshWindowTreeHost::Create(params_with_bounds).release(); |
| 826 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); | 826 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); |
| 827 // In mash input method is hosted by the browser process, so we don't need to | 827 // When using IME service, input method is hosted by the browser process, so |
| 828 // create and set it here. | 828 // we don't need to create and set it here. |
| 829 if (Shell::GetAshConfig() != Config::MASH) { | 829 if (!Shell::ShouldUseIMEService()) { |
| 830 DCHECK(!host->has_input_method()); | 830 DCHECK(!host->has_input_method()); |
| 831 if (!input_method_) { // Singleton input method instance for Ash. | 831 if (!input_method_) { // Singleton input method instance for Ash. |
| 832 input_method_ = ui::CreateInputMethod(this, host->GetAcceleratedWidget()); | 832 input_method_ = ui::CreateInputMethod(this, host->GetAcceleratedWidget()); |
| 833 // Makes sure the input method is focused by default when created, because | 833 // Makes sure the input method is focused by default when created, because |
| 834 // Ash uses singleton InputMethod and it won't call OnFocus/OnBlur when | 834 // Ash uses singleton InputMethod and it won't call OnFocus/OnBlur when |
| 835 // the active window changed. | 835 // the active window changed. |
| 836 input_method_->OnFocus(); | 836 input_method_->OnFocus(); |
| 837 input_method_event_handler_.reset( | 837 input_method_event_handler_.reset( |
| 838 new InputMethodEventHandler(input_method_.get())); | 838 new InputMethodEventHandler(input_method_.get())); |
| 839 } | 839 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 855 | 855 |
| 856 window_tree_hosts_[display.id()] = ash_host; | 856 window_tree_hosts_[display.id()] = ash_host; |
| 857 SetDisplayPropertiesOnHost(ash_host, display); | 857 SetDisplayPropertiesOnHost(ash_host, display); |
| 858 | 858 |
| 859 if (switches::ConstrainPointerToRoot()) | 859 if (switches::ConstrainPointerToRoot()) |
| 860 ash_host->ConfineCursorToRootWindow(); | 860 ash_host->ConfineCursorToRootWindow(); |
| 861 return ash_host; | 861 return ash_host; |
| 862 } | 862 } |
| 863 | 863 |
| 864 } // namespace ash | 864 } // namespace ash |
| OLD | NEW |