Index: views/controls/native_control_wayland.h |
diff --git a/views/controls/native_control_wayland.h b/views/controls/native_control_wayland.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..508bf2f536126115e70f92d829025f5672ccf923 |
--- /dev/null |
+++ b/views/controls/native_control_wayland.h |
@@ -0,0 +1,58 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef VIEWS_CONTROLS_NATIVE_CONTROL_WAYLAND_H_ |
+#define VIEWS_CONTROLS_NATIVE_CONTROL_WAYLAND_H_ |
+#pragma once |
+ |
+#include "views/controls/native/native_view_host.h" |
+ |
+namespace ui { |
+class WaylandWidget; |
+} // namespace ui |
+ |
+namespace views { |
+ |
+// A View that hosts a native control. |
+class NativeControlWayland : public NativeViewHost { |
+ public: |
+ NativeControlWayland(); |
+ virtual ~NativeControlWayland(); |
+ |
+ // Overridden from View: |
+ virtual void OnEnabledChanged(); |
+ |
+ protected: |
+ virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); |
+ virtual void VisibilityChanged(View* starting_from, bool is_visible); |
+ virtual void OnFocus(); |
+#if defined(TOUCH_UI) |
+ virtual bool OnMousePressed(const MouseEvent& event); |
+ virtual void OnMouseReleased(const MouseEvent& event); |
+ virtual void OnMouseMoved(const MouseEvent& event); |
+ virtual void OnMouseExited(const MouseEvent& event); |
+ virtual void OnMouseEntered(const MouseEvent& event); |
+ |
+ // Fake a mouse event. |
+ void FakeNativeMouseEvent(const MouseEvent& event); |
+#endif |
+ |
+ // Called when the NativeControlWayland is attached to a View hierarchy with a |
+ // valid Widget. The NativeControlWayland should use this opportunity to |
+ // create its associated WaylandWidget. |
+ virtual void CreateNativeControl() = 0; |
+ |
+ // MUST be called by the subclass implementation of |CreateNativeControl| |
+ // immediately after creating the control WaylandWidget, otherwise it won't be |
+ // attached to the WaylandView and will be effectively orphaned. |
+ virtual void NativeControlCreated(ui::WaylandWidget* widget); |
+ |
+ private: |
+ |
+ DISALLOW_COPY_AND_ASSIGN(NativeControlWayland); |
+}; |
+ |
+} // namespace views |
+ |
+#endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_WAYLAND_H_ |