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/host/ash_window_tree_host.h" | 5 #include "ash/host/ash_window_tree_host.h" |
6 | 6 |
7 #include "ash/host/ash_window_tree_host_init_params.h" | 7 #include "ash/host/ash_window_tree_host_init_params.h" |
8 #include "ash/host/ash_window_tree_host_unified.h" | 8 #include "ash/host/ash_window_tree_host_unified.h" |
| 9 #include "ash/shell_port.h" |
9 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
10 #include "ui/aura/window_tree_host.h" | 11 #include "ui/aura/window_tree_host.h" |
11 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
13 | 14 |
14 #if defined(USE_OZONE) | 15 #if defined(USE_OZONE) |
15 #include "ash/host/ash_window_tree_host_platform.h" | 16 #include "ash/host/ash_window_tree_host_platform.h" |
16 #elif defined(USE_X11) | 17 #elif defined(USE_X11) |
17 #include "ash/host/ash_window_tree_host_x11.h" | 18 #include "ash/host/ash_window_tree_host_x11.h" |
18 #endif | 19 #endif |
(...skipping 23 matching lines...) Expand all Loading... |
42 screen_position_client->ConvertPointFromScreen(root_window, &location); | 43 screen_position_client->ConvertPointFromScreen(root_window, &location); |
43 wth->ConvertDIPToPixels(&location); | 44 wth->ConvertDIPToPixels(&location); |
44 event->set_location(location); | 45 event->set_location(location); |
45 event->set_root_location(location); | 46 event->set_root_location(location); |
46 } | 47 } |
47 } | 48 } |
48 | 49 |
49 // static | 50 // static |
50 AshWindowTreeHost* AshWindowTreeHost::Create( | 51 AshWindowTreeHost* AshWindowTreeHost::Create( |
51 const AshWindowTreeHostInitParams& init_params) { | 52 const AshWindowTreeHostInitParams& init_params) { |
| 53 AshWindowTreeHost* ash_window_tree_host = |
| 54 ShellPort::Get()->CreateAshWindowTreeHost(init_params); |
| 55 if (ash_window_tree_host) |
| 56 return ash_window_tree_host; |
| 57 |
52 if (init_params.offscreen) | 58 if (init_params.offscreen) |
53 return new AshWindowTreeHostUnified(init_params.initial_bounds); | 59 return new AshWindowTreeHostUnified(init_params.initial_bounds); |
54 #if defined(USE_OZONE) | 60 #if defined(USE_OZONE) |
55 return new AshWindowTreeHostPlatform(init_params.initial_bounds); | 61 return new AshWindowTreeHostPlatform(init_params.initial_bounds); |
56 #elif defined(USE_X11) | 62 #elif defined(USE_X11) |
57 return new AshWindowTreeHostX11(init_params.initial_bounds); | 63 return new AshWindowTreeHostX11(init_params.initial_bounds); |
58 #else | 64 #else |
59 #error Unsupported platform. | 65 #error Unsupported platform. |
60 #endif | 66 #endif |
61 } | 67 } |
62 | 68 |
63 } // namespace ash | 69 } // namespace ash |
OLD | NEW |