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

Side by Side Diff: content/renderer/mus/compositor_mus_connection.h

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: fix navigation Created 4 years, 3 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
« no previous file with comments | « ash/mus/window_manager_unittest.cc ('k') | content/renderer/mus/compositor_mus_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 5 #ifndef CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
6 #define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 6 #define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
7 7
8 #include <memory>
9
8 #include "base/bind.h" 10 #include "base/bind.h"
9 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
10 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/synchronization/lock.h"
11 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
12 #include "services/ui/public/cpp/input_event_handler.h" 15 #include "services/ui/public/cpp/input_event_handler.h"
13 #include "services/ui/public/cpp/window.h" 16 #include "services/ui/public/cpp/window.h"
14 #include "services/ui/public/cpp/window_tree_client.h" 17 #include "services/ui/public/cpp/window_tree_client.h"
15 #include "services/ui/public/cpp/window_tree_client_delegate.h" 18 #include "services/ui/public/cpp/window_tree_client_delegate.h"
16 #include "third_party/WebKit/public/web/WebInputEvent.h" 19 #include "third_party/WebKit/public/web/WebInputEvent.h"
17 #include "ui/events/gestures/motion_event_aura.h" 20 #include "ui/events/gestures/motion_event_aura.h"
18 21
19 namespace ui { 22 namespace ui {
20 struct DidOverscrollParams; 23 struct DidOverscrollParams;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void OnWindowInputEventOnMainThread( 68 void OnWindowInputEventOnMainThread(
66 std::unique_ptr<blink::WebInputEvent> web_event, 69 std::unique_ptr<blink::WebInputEvent> web_event,
67 const base::Callback<void(ui::mojom::EventResult)>& ack); 70 const base::Callback<void(ui::mojom::EventResult)>& ack);
68 71
69 void OnWindowInputEventAckOnMainThread( 72 void OnWindowInputEventAckOnMainThread(
70 const base::Callback<void(ui::mojom::EventResult)>& ack, 73 const base::Callback<void(ui::mojom::EventResult)>& ack,
71 ui::mojom::EventResult result); 74 ui::mojom::EventResult result);
72 75
73 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event); 76 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event);
74 77
78 void DeleteWindowTreeClient();
79
75 // WindowTreeClientDelegate implementation: 80 // WindowTreeClientDelegate implementation:
76 void OnDidDestroyClient(ui::WindowTreeClient* client) override;
77 void OnEmbed(ui::Window* root) override; 81 void OnEmbed(ui::Window* root) override;
82 void OnEmbedRootDestroyed(ui::Window* root) override;
83 void OnLostConnection(ui::WindowTreeClient* client) override;
78 void OnPointerEventObserved(const ui::PointerEvent& event, 84 void OnPointerEventObserved(const ui::PointerEvent& event,
79 ui::Window* target) override; 85 ui::Window* target) override;
80 86
81 // InputEventHandler implementation: 87 // InputEventHandler implementation:
82 void OnWindowInputEvent( 88 void OnWindowInputEvent(
83 ui::Window* window, 89 ui::Window* window,
84 const ui::Event& event, 90 const ui::Event& event,
85 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* 91 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>*
86 ack_callback) override; 92 ack_callback) override;
87 93
88 const int routing_id_; 94 const int routing_id_;
95 // Use this lock when accessing |window_tree_client_|. Lock exists solely for
96 // DCHECK in destructor.
97 base::Lock window_tree_client_lock_;
98 std::unique_ptr<ui::WindowTreeClient> window_tree_client_;
89 ui::Window* root_; 99 ui::Window* root_;
90 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 100 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
91 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 101 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
92 InputHandlerManager* const input_handler_manager_; 102 InputHandlerManager* const input_handler_manager_;
93 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_; 103 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_;
94 104
95 // Stores the current state of the active pointers targeting this object. 105 // Stores the current state of the active pointers targeting this object.
96 ui::MotionEventAura pointer_state_; 106 ui::MotionEventAura pointer_state_;
97 107
98 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); 108 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection);
99 }; 109 };
100 110
101 } // namespace content 111 } // namespace content
102 112
103 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 113 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
OLDNEW
« no previous file with comments | « ash/mus/window_manager_unittest.cc ('k') | content/renderer/mus/compositor_mus_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698