| 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 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Removes the window association for |widget|. Note: |widget| must be | 32 // Removes the window association for |widget|. Note: |widget| must be |
| 33 // associated with a window when calling this function. | 33 // associated with a window when calling this function. |
| 34 void RemoveWindow(gfx::AcceleratedWidget widget); | 34 void RemoveWindow(gfx::AcceleratedWidget widget); |
| 35 | 35 |
| 36 // Returns the window associated with |widget|. Note: This function should | 36 // Returns the window associated with |widget|. Note: This function should |
| 37 // only be called if a valid window has been associated. | 37 // only be called if a valid window has been associated. |
| 38 DriWindow* GetWindow(gfx::AcceleratedWidget widget); | 38 DriWindow* GetWindow(gfx::AcceleratedWidget widget); |
| 39 | 39 |
| 40 DriCursor* cursor() const { return cursor_.get(); } | 40 DriCursor* cursor() const { return cursor_.get(); } |
| 41 | 41 |
| 42 // Sets a given widget as the recipient for mouse events. |
| 43 void GrabMouseEvents(gfx::AcceleratedWidget widget); |
| 44 |
| 45 // Unsets a given widget as the recipient for mouse events. |
| 46 void UngrabMouseEvents(gfx::AcceleratedWidget widget); |
| 47 |
| 48 // Gets the widget current recipient of mouse events. |
| 49 gfx::AcceleratedWidget mouse_events_grabber() const { |
| 50 return mouse_events_grabber_; |
| 51 } |
| 52 |
| 42 private: | 53 private: |
| 43 // Reset the cursor location based on the list of active windows. | 54 // Reset the cursor location based on the list of active windows. |
| 44 void ResetCursorLocation(); | 55 void ResetCursorLocation(); |
| 45 | 56 |
| 46 typedef std::map<gfx::AcceleratedWidget, DriWindow*> WidgetToWindowMap; | 57 typedef std::map<gfx::AcceleratedWidget, DriWindow*> WidgetToWindowMap; |
| 47 | 58 |
| 48 gfx::AcceleratedWidget last_allocated_widget_; | 59 gfx::AcceleratedWidget last_allocated_widget_; |
| 49 WidgetToWindowMap window_map_; | 60 WidgetToWindowMap window_map_; |
| 50 | 61 |
| 51 scoped_ptr<DriCursor> cursor_; | 62 scoped_ptr<DriCursor> cursor_; |
| 52 | 63 |
| 64 gfx::AcceleratedWidget mouse_events_grabber_; |
| 65 |
| 53 DISALLOW_COPY_AND_ASSIGN(DriWindowManager); | 66 DISALLOW_COPY_AND_ASSIGN(DriWindowManager); |
| 54 }; | 67 }; |
| 55 | 68 |
| 56 } // namespace ui | 69 } // namespace ui |
| 57 | 70 |
| 58 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_ | 71 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_ |
| OLD | NEW |