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 12 matching lines...) Expand all Loading... |
23 #include "ash/magnifier/magnification_controller.h" | 23 #include "ash/magnifier/magnification_controller.h" |
24 #include "ash/magnifier/partial_magnification_controller.h" | 24 #include "ash/magnifier/partial_magnification_controller.h" |
25 #include "ash/root_window_controller.h" | 25 #include "ash/root_window_controller.h" |
26 #include "ash/root_window_settings.h" | 26 #include "ash/root_window_settings.h" |
27 #include "ash/shell.h" | 27 #include "ash/shell.h" |
28 #include "ash/wm/window_util.h" | 28 #include "ash/wm/window_util.h" |
29 #include "base/command_line.h" | 29 #include "base/command_line.h" |
30 #include "base/strings/stringprintf.h" | 30 #include "base/strings/stringprintf.h" |
31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
32 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
| 33 #include "grit/ash_strings.h" |
33 #include "ui/aura/client/capture_client.h" | 34 #include "ui/aura/client/capture_client.h" |
34 #include "ui/aura/client/focus_client.h" | 35 #include "ui/aura/client/focus_client.h" |
35 #include "ui/aura/client/screen_position_client.h" | 36 #include "ui/aura/client/screen_position_client.h" |
36 #include "ui/aura/window.h" | 37 #include "ui/aura/window.h" |
37 #include "ui/aura/window_event_dispatcher.h" | 38 #include "ui/aura/window_event_dispatcher.h" |
38 #include "ui/aura/window_property.h" | 39 #include "ui/aura/window_property.h" |
39 #include "ui/aura/window_tracker.h" | 40 #include "ui/aura/window_tracker.h" |
40 #include "ui/aura/window_tree_host.h" | 41 #include "ui/aura/window_tree_host.h" |
41 #include "ui/base/ime/input_method_factory.h" | 42 #include "ui/base/ime/input_method_factory.h" |
| 43 #include "ui/base/l10n/l10n_util.h" |
42 #include "ui/compositor/compositor.h" | 44 #include "ui/compositor/compositor.h" |
43 #include "ui/display/display.h" | 45 #include "ui/display/display.h" |
44 #include "ui/display/manager/display_layout.h" | 46 #include "ui/display/manager/display_layout.h" |
45 #include "ui/display/manager/display_layout_store.h" | 47 #include "ui/display/manager/display_layout_store.h" |
46 #include "ui/display/screen.h" | 48 #include "ui/display/screen.h" |
47 #include "ui/wm/core/coordinate_conversion.h" | 49 #include "ui/wm/core/coordinate_conversion.h" |
48 #include "ui/wm/public/activation_client.h" | 50 #include "ui/wm/public/activation_client.h" |
49 | 51 |
50 #if defined(USE_X11) | 52 #if defined(USE_X11) |
51 #include "ui/base/x/x11_util.h" // nogncheck | 53 #include "ui/base/x/x11_util.h" // nogncheck |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanged()); | 797 FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanged()); |
796 UpdateMouseLocationAfterDisplayChange(); | 798 UpdateMouseLocationAfterDisplayChange(); |
797 } | 799 } |
798 | 800 |
799 #if defined(OS_CHROMEOS) | 801 #if defined(OS_CHROMEOS) |
800 ui::DisplayConfigurator* WindowTreeHostManager::display_configurator() { | 802 ui::DisplayConfigurator* WindowTreeHostManager::display_configurator() { |
801 return Shell::GetInstance()->display_configurator(); | 803 return Shell::GetInstance()->display_configurator(); |
802 } | 804 } |
803 #endif | 805 #endif |
804 | 806 |
| 807 std::string WindowTreeHostManager::GetInternalDisplayNameString() { |
| 808 return l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME); |
| 809 } |
| 810 |
| 811 std::string WindowTreeHostManager::GetUnknownDisplayNameString() { |
| 812 return l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); |
| 813 } |
| 814 |
805 ui::EventDispatchDetails WindowTreeHostManager::DispatchKeyEventPostIME( | 815 ui::EventDispatchDetails WindowTreeHostManager::DispatchKeyEventPostIME( |
806 ui::KeyEvent* event) { | 816 ui::KeyEvent* event) { |
807 // Getting the active root window to dispatch the event. This isn't | 817 // Getting the active root window to dispatch the event. This isn't |
808 // significant as the event will be sent to the window resolved by | 818 // significant as the event will be sent to the window resolved by |
809 // aura::client::FocusClient which is FocusController in ash. | 819 // aura::client::FocusClient which is FocusController in ash. |
810 aura::Window* active_window = wm::GetActiveWindow(); | 820 aura::Window* active_window = wm::GetActiveWindow(); |
811 aura::Window* root_window = active_window ? active_window->GetRootWindow() | 821 aura::Window* root_window = active_window ? active_window->GetRootWindow() |
812 : Shell::GetPrimaryRootWindow(); | 822 : Shell::GetPrimaryRootWindow(); |
813 return root_window->GetHost()->DispatchKeyEventPostIME(event); | 823 return root_window->GetHost()->DispatchKeyEventPostIME(event); |
814 } | 824 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 SetDisplayPropertiesOnHost(ash_host, display); | 862 SetDisplayPropertiesOnHost(ash_host, display); |
853 | 863 |
854 #if defined(OS_CHROMEOS) | 864 #if defined(OS_CHROMEOS) |
855 if (switches::ConstrainPointerToRoot()) | 865 if (switches::ConstrainPointerToRoot()) |
856 ash_host->ConfineCursorToRootWindow(); | 866 ash_host->ConfineCursorToRootWindow(); |
857 #endif | 867 #endif |
858 return ash_host; | 868 return ash_host; |
859 } | 869 } |
860 | 870 |
861 } // namespace ash | 871 } // namespace ash |
OLD | NEW |