Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(687)

Side by Side Diff: components/mus/public/cpp/lib/window_tree_client_impl.h

Issue 1881253002: mus: Implement ScreenMus::GetCursorScreenPoint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows more. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <set> 11 #include <set>
12 12
13 #include "base/atomicops.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h"
14 #include "base/observer_list.h" 16 #include "base/observer_list.h"
15 #include "components/mus/common/types.h" 17 #include "components/mus/common/types.h"
16 #include "components/mus/public/cpp/window.h" 18 #include "components/mus/public/cpp/window.h"
17 #include "components/mus/public/cpp/window_manager_delegate.h" 19 #include "components/mus/public/cpp/window_manager_delegate.h"
18 #include "components/mus/public/cpp/window_tree_connection.h" 20 #include "components/mus/public/cpp/window_tree_connection.h"
19 #include "components/mus/public/interfaces/window_tree.mojom.h" 21 #include "components/mus/public/interfaces/window_tree.mojom.h"
20 #include "mojo/public/cpp/bindings/associated_binding.h" 22 #include "mojo/public/cpp/bindings/associated_binding.h"
21 #include "mojo/public/cpp/bindings/strong_binding.h" 23 #include "mojo/public/cpp/bindings/strong_binding.h"
22 24
23 namespace gfx { 25 namespace gfx {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 Window* NewWindowImpl(NewWindowType type, 157 Window* NewWindowImpl(NewWindowType type,
156 const Window::SharedProperties* properties); 158 const Window::SharedProperties* properties);
157 159
158 // OnEmbed() calls into this. Exposed as a separate function for testing. 160 // OnEmbed() calls into this. Exposed as a separate function for testing.
159 void OnEmbedImpl(mojom::WindowTree* window_tree, 161 void OnEmbedImpl(mojom::WindowTree* window_tree,
160 ConnectionSpecificId connection_id, 162 ConnectionSpecificId connection_id,
161 mojom::WindowDataPtr root_data, 163 mojom::WindowDataPtr root_data,
162 Id focused_window_id, 164 Id focused_window_id,
163 bool drawn); 165 bool drawn);
164 166
167 void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle);
168
165 // Overridden from WindowTreeConnection: 169 // Overridden from WindowTreeConnection:
166 void SetDeleteOnNoRoots(bool value) override; 170 void SetDeleteOnNoRoots(bool value) override;
167 const std::set<Window*>& GetRoots() override; 171 const std::set<Window*>& GetRoots() override;
168 Window* GetFocusedWindow() override; 172 Window* GetFocusedWindow() override;
169 void ClearFocus() override; 173 void ClearFocus() override;
174 void InitializeCursorLocation() override;
175 gfx::Point GetCursorScreenPoint() override;
170 Window* NewWindow(const Window::SharedProperties* properties) override; 176 Window* NewWindow(const Window::SharedProperties* properties) override;
171 Window* NewTopLevelWindow( 177 Window* NewTopLevelWindow(
172 const Window::SharedProperties* properties) override; 178 const Window::SharedProperties* properties) override;
173 ConnectionSpecificId GetConnectionId() override; 179 ConnectionSpecificId GetConnectionId() override;
174 void AddObserver(WindowTreeConnectionObserver* observer) override; 180 void AddObserver(WindowTreeConnectionObserver* observer) override;
175 void RemoveObserver(WindowTreeConnectionObserver* observer) override; 181 void RemoveObserver(WindowTreeConnectionObserver* observer) override;
176 182
177 // Overridden from WindowTreeClient: 183 // Overridden from WindowTreeClient:
178 void OnEmbed(ConnectionSpecificId connection_id, 184 void OnEmbed(ConnectionSpecificId connection_id,
179 mojom::WindowDataPtr root, 185 mojom::WindowDataPtr root,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 mojo::Binding<WindowTreeClient> binding_; 289 mojo::Binding<WindowTreeClient> binding_;
284 mojom::WindowTreePtr tree_ptr_; 290 mojom::WindowTreePtr tree_ptr_;
285 // Typically this is the value contained in |tree_ptr_|, but tests may 291 // Typically this is the value contained in |tree_ptr_|, but tests may
286 // directly set this. 292 // directly set this.
287 mojom::WindowTree* tree_; 293 mojom::WindowTree* tree_;
288 294
289 bool delete_on_no_roots_; 295 bool delete_on_no_roots_;
290 296
291 bool in_destructor_; 297 bool in_destructor_;
292 298
299 bool called_initialize_cursor_location_;
300
301 // A handle to shared memory that is one 65 bit integer long. The window
302 // server uses this to let us synchronously read the cursor location.
303 mojo::ScopedSharedBufferHandle cursor_location_handle_;
304
305 // The one int64 in |cursor_location_handle_|. When we read from this
306 // location, we must always read from it atomically.
307 base::subtle::Atomic64* cursor_location_memory_;
308
293 base::ObserverList<WindowTreeConnectionObserver> observers_; 309 base::ObserverList<WindowTreeConnectionObserver> observers_;
294 310
295 scoped_ptr<mojo::AssociatedBinding<mojom::WindowManager>> 311 scoped_ptr<mojo::AssociatedBinding<mojom::WindowManager>>
296 window_manager_internal_; 312 window_manager_internal_;
297 mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_; 313 mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_;
298 314
315 base::WeakPtrFactory<WindowTreeClientImpl> weak_factory_;
316
299 DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); 317 DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl);
300 }; 318 };
301 319
302 } // namespace mus 320 } // namespace mus
303 321
304 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ 322 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698