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

Unified Diff: content/renderer/render_widget_mus_connection.h

Issue 1484013003: mustash: Implement basic input event routing in renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed copyright Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_widget_mus_connection.h
diff --git a/content/renderer/render_widget_mus_connection.h b/content/renderer/render_widget_mus_connection.h
index b3f45494b34b5b4e43c035ff54f1f68fad9fb4e3..316fbbc875fe46e4af7d30e83c9a1be010ec04e1 100644
--- a/content/renderer/render_widget_mus_connection.h
+++ b/content/renderer/render_widget_mus_connection.h
@@ -6,44 +6,46 @@
#define CONTENT_RENDERER_RENDER_WIDGET_MUS_CONNECTION_H_
#include "base/macros.h"
+#include "base/threading/thread_checker.h"
#include "cc/output/output_surface.h"
-#include "components/mus/public/cpp/window.h"
-#include "components/mus/public/cpp/window_observer.h"
#include "components/mus/public/cpp/window_surface.h"
-#include "components/mus/public/cpp/window_tree_connection.h"
-#include "components/mus/public/cpp/window_tree_delegate.h"
-#include "mojo/public/cpp/bindings/binding.h"
+#include "content/renderer/compositor_mus_connection.h"
namespace content {
-class RenderWidgetMusConnection : public mus::WindowTreeDelegate,
- public mus::WindowObserver {
- public:
- explicit RenderWidgetMusConnection(int routing_id);
- ~RenderWidgetMusConnection() override;
+class InputHandlerManager;
- // Connect to a WindowTreeClient request.
+// Use on main thread.
+class RenderWidgetMusConnection {
+ public:
+ // Bind to a WindowTreeClient request.
void Bind(mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request);
// Create a cc output surface.
scoped_ptr<cc::OutputSurface> CreateOutputSurface();
+ static RenderWidgetMusConnection* Get(int routing_id);
+
// Get the connection from a routing_id, if the connection doesn't exist,
// a new connection will be created.
static RenderWidgetMusConnection* GetOrCreate(int routing_id);
private:
- // WindowTreeDelegate implementation:
- void OnConnectionLost(mus::WindowTreeConnection* connection) override;
- void OnEmbed(mus::Window* root) override;
- void OnUnembed() override;
- void OnWindowBoundsChanged(mus::Window* window,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) override;
+ friend class CompositorMusConnection;
+
+ explicit RenderWidgetMusConnection(int routing_id);
+ ~RenderWidgetMusConnection();
+
+ void OnConnectionLost();
+ void OnWindowInputEvent(scoped_ptr<blink::WebInputEvent> input_event,
+ const base::Closure& ack);
const int routing_id_;
- mus::Window* root_;
scoped_ptr<mus::WindowSurfaceBinding> window_surface_binding_;
+ scoped_refptr<CompositorMusConnection> compositor_mus_connection_;
+
+ // Used to verify single threaded access.
+ base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetMusConnection);
};

Powered by Google App Engine
This is Rietveld 408576698