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 "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 local.Inset(GetHostInsets()); | 43 local.Inset(GetHostInsets()); |
44 | 44 |
45 if (screen_position_client && !local.Contains(event->location())) { | 45 if (screen_position_client && !local.Contains(event->location())) { |
46 gfx::Point location(event->location()); | 46 gfx::Point location(event->location()); |
47 // In order to get the correct point in screen coordinates | 47 // In order to get the correct point in screen coordinates |
48 // during passive grab, we first need to find on which host window | 48 // during passive grab, we first need to find on which host window |
49 // the mouse is on, and find out the screen coordinates on that | 49 // the mouse is on, and find out the screen coordinates on that |
50 // host window, then convert it back to this host window's coordinate. | 50 // host window, then convert it back to this host window's coordinate. |
51 screen_position_client->ConvertHostPointToScreen(root_window, &location); | 51 screen_position_client->ConvertHostPointToScreen(root_window, &location); |
52 screen_position_client->ConvertPointFromScreen(root_window, &location); | 52 screen_position_client->ConvertPointFromScreen(root_window, &location); |
53 wth->ConvertPointToHost(&location); | 53 wth->ConvertDIPToPixels(&location); |
54 event->set_location(location); | 54 event->set_location(location); |
55 event->set_root_location(location); | 55 event->set_root_location(location); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 // static | 59 // static |
60 AshWindowTreeHost* AshWindowTreeHost::Create( | 60 AshWindowTreeHost* AshWindowTreeHost::Create( |
61 const AshWindowTreeHostInitParams& init_params) { | 61 const AshWindowTreeHostInitParams& init_params) { |
62 if (!creation_factory.Get().is_null()) | 62 if (!creation_factory.Get().is_null()) |
63 return creation_factory.Get().Run(init_params); | 63 return creation_factory.Get().Run(init_params); |
(...skipping 10 matching lines...) Expand all Loading... |
74 #error Unsupported platform. | 74 #error Unsupported platform. |
75 #endif | 75 #endif |
76 } | 76 } |
77 | 77 |
78 // static | 78 // static |
79 void AshWindowTreeHost::SetFactory(const Factory& factory) { | 79 void AshWindowTreeHost::SetFactory(const Factory& factory) { |
80 creation_factory.Get() = factory; | 80 creation_factory.Get() = factory; |
81 } | 81 } |
82 | 82 |
83 } // namespace ash | 83 } // namespace ash |
OLD | NEW |