| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_UI_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_ |
| 6 #define SERVICES_UI_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // functions. Returns false if one of the WindowTree functions has not been | 24 // functions. Returns false if one of the WindowTree functions has not been |
| 25 // invoked since the last GetAndClearChangeId(). | 25 // invoked since the last GetAndClearChangeId(). |
| 26 bool GetAndClearChangeId(uint32_t* change_id); | 26 bool GetAndClearChangeId(uint32_t* change_id); |
| 27 | 27 |
| 28 uint32_t window_id() const { return window_id_; } | 28 uint32_t window_id() const { return window_id_; } |
| 29 | 29 |
| 30 bool WasEventAcked(uint32_t event_id) const; | 30 bool WasEventAcked(uint32_t event_id) const; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // mojom::WindowTree: | 33 // mojom::WindowTree: |
| 34 void NewWindow( | 34 void NewWindow(uint32_t change_id, |
| 35 uint32_t change_id, | 35 uint32_t window_id, |
| 36 uint32_t window_id, | 36 const base::Optional< |
| 37 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override; | 37 std::unordered_map<std::string, std::vector<uint8_t>>>& |
| 38 properties) override; |
| 38 void NewTopLevelWindow( | 39 void NewTopLevelWindow( |
| 39 uint32_t change_id, | 40 uint32_t change_id, |
| 40 uint32_t window_id, | 41 uint32_t window_id, |
| 41 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override; | 42 const std::unordered_map<std::string, std::vector<uint8_t>>& properties) |
| 43 override; |
| 42 void DeleteWindow(uint32_t change_id, uint32_t window_id) override; | 44 void DeleteWindow(uint32_t change_id, uint32_t window_id) override; |
| 43 void SetWindowBounds(uint32_t change_id, | 45 void SetWindowBounds(uint32_t change_id, |
| 44 uint32_t window_id, | 46 uint32_t window_id, |
| 45 const gfx::Rect& bounds) override; | 47 const gfx::Rect& bounds) override; |
| 46 void SetClientArea(uint32_t window_id, | 48 void SetClientArea(uint32_t window_id, |
| 47 const gfx::Insets& insets, | 49 const gfx::Insets& insets, |
| 48 mojo::Array<gfx::Rect> additional_client_areas) override; | 50 const base::Optional<std::vector<gfx::Rect>>& |
| 51 additional_client_areas) override; |
| 49 void SetHitTestMask(uint32_t window_id, | 52 void SetHitTestMask(uint32_t window_id, |
| 50 const base::Optional<gfx::Rect>& mask) override; | 53 const base::Optional<gfx::Rect>& mask) override; |
| 51 void SetCanAcceptDrops(uint32_t window_id, bool accepts_drags) override; | 54 void SetCanAcceptDrops(uint32_t window_id, bool accepts_drags) override; |
| 52 void SetWindowVisibility(uint32_t change_id, | 55 void SetWindowVisibility(uint32_t change_id, |
| 53 uint32_t window_id, | 56 uint32_t window_id, |
| 54 bool visible) override; | 57 bool visible) override; |
| 55 void SetWindowProperty(uint32_t change_id, | 58 void SetWindowProperty( |
| 56 uint32_t window_id, | 59 uint32_t change_id, |
| 57 const mojo::String& name, | 60 uint32_t window_id, |
| 58 mojo::Array<uint8_t> value) override; | 61 const std::string& name, |
| 62 const base::Optional<std::vector<uint8_t>>& value) override; |
| 59 void SetWindowOpacity(uint32_t change_id, | 63 void SetWindowOpacity(uint32_t change_id, |
| 60 uint32_t window_id, | 64 uint32_t window_id, |
| 61 float opacity) override; | 65 float opacity) override; |
| 62 void AttachCompositorFrameSink( | 66 void AttachCompositorFrameSink( |
| 63 uint32_t window_id, | 67 uint32_t window_id, |
| 64 mojom::CompositorFrameSinkType type, | 68 mojom::CompositorFrameSinkType type, |
| 65 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> surface, | 69 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> surface, |
| 66 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; | 70 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; |
| 67 void AddWindow(uint32_t change_id, uint32_t parent, uint32_t child) override; | 71 void AddWindow(uint32_t change_id, uint32_t parent, uint32_t child) override; |
| 68 void RemoveWindowFromParent(uint32_t change_id, uint32_t window_id) override; | 72 void RemoveWindowFromParent(uint32_t change_id, uint32_t window_id) override; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 97 void SetImeVisibility(uint32_t window_id, | 101 void SetImeVisibility(uint32_t window_id, |
| 98 bool visible, | 102 bool visible, |
| 99 mojo::TextInputStatePtr state) override; | 103 mojo::TextInputStatePtr state) override; |
| 100 void OnWindowInputEventAck(uint32_t event_id, | 104 void OnWindowInputEventAck(uint32_t event_id, |
| 101 ui::mojom::EventResult result) override; | 105 ui::mojom::EventResult result) override; |
| 102 void GetWindowManagerClient( | 106 void GetWindowManagerClient( |
| 103 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) | 107 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) |
| 104 override; | 108 override; |
| 105 void GetCursorLocationMemory(const GetCursorLocationMemoryCallback& callback) | 109 void GetCursorLocationMemory(const GetCursorLocationMemoryCallback& callback) |
| 106 override; | 110 override; |
| 107 void PerformDragDrop(uint32_t change_id, | 111 void PerformDragDrop( |
| 108 uint32_t source_window_id, | 112 uint32_t change_id, |
| 109 mojo::Map<mojo::String, mojo::Array<uint8_t>> drag_data, | 113 uint32_t source_window_id, |
| 110 uint32_t drag_operation) override; | 114 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, |
| 115 uint32_t drag_operation) override; |
| 111 void CancelDragDrop(uint32_t window_id) override; | 116 void CancelDragDrop(uint32_t window_id) override; |
| 112 void PerformWindowMove(uint32_t change_id, | 117 void PerformWindowMove(uint32_t change_id, |
| 113 uint32_t window_id, | 118 uint32_t window_id, |
| 114 mojom::MoveLoopSource source, | 119 mojom::MoveLoopSource source, |
| 115 const gfx::Point& cursor_location) override; | 120 const gfx::Point& cursor_location) override; |
| 116 void CancelWindowMove(uint32_t window_id) override; | 121 void CancelWindowMove(uint32_t window_id) override; |
| 117 | 122 |
| 118 bool got_change_; | 123 bool got_change_; |
| 119 uint32_t change_id_; | 124 uint32_t change_id_; |
| 120 std::set<uint32_t> acked_events_; | 125 std::set<uint32_t> acked_events_; |
| 121 uint32_t window_id_; | 126 uint32_t window_id_; |
| 122 | 127 |
| 123 DISALLOW_COPY_AND_ASSIGN(TestWindowTree); | 128 DISALLOW_COPY_AND_ASSIGN(TestWindowTree); |
| 124 }; | 129 }; |
| 125 | 130 |
| 126 } // namespace ui | 131 } // namespace ui |
| 127 | 132 |
| 128 #endif // SERVICES_UI_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_ | 133 #endif // SERVICES_UI_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_H_ |
| OLD | NEW |