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

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: Actually apply the 32bit patch now that the delegate crash was fixed. Created 4 years, 7 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 mojo::Binding<WindowTreeClient> binding_; 292 mojo::Binding<WindowTreeClient> binding_;
287 mojom::WindowTreePtr tree_ptr_; 293 mojom::WindowTreePtr tree_ptr_;
288 // Typically this is the value contained in |tree_ptr_|, but tests may 294 // Typically this is the value contained in |tree_ptr_|, but tests may
289 // directly set this. 295 // directly set this.
290 mojom::WindowTree* tree_; 296 mojom::WindowTree* tree_;
291 297
292 bool delete_on_no_roots_; 298 bool delete_on_no_roots_;
293 299
294 bool in_destructor_; 300 bool in_destructor_;
295 301
302 bool called_initialize_cursor_location_;
sky 2016/04/27 20:10:28 Add comment.
303
304 // A handle to shared memory that is one 65 bit integer long. The window
sky 2016/04/27 20:10:28 32?
305 // server uses this to let us synchronously read the cursor location.
306 mojo::ScopedSharedBufferHandle cursor_location_handle_;
307
308 // The one int in |cursor_location_handle_|. When we read from this
309 // location, we must always read from it atomically.
310 base::subtle::Atomic32* cursor_location_memory_;
311
296 base::ObserverList<WindowTreeConnectionObserver> observers_; 312 base::ObserverList<WindowTreeConnectionObserver> observers_;
297 313
298 std::unique_ptr<mojo::AssociatedBinding<mojom::WindowManager>> 314 std::unique_ptr<mojo::AssociatedBinding<mojom::WindowManager>>
299 window_manager_internal_; 315 window_manager_internal_;
300 mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_; 316 mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_;
301 317
318 base::WeakPtrFactory<WindowTreeClientImpl> weak_factory_;
319
302 DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl); 320 DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl);
303 }; 321 };
304 322
305 } // namespace mus 323 } // namespace mus
306 324
307 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_ 325 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_WINDOW_TREE_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698