summaryrefslogtreecommitdiffstats
path: root/views/controls/native_control_gtk.h
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/native_control_gtk.h')
-rw-r--r--views/controls/native_control_gtk.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/views/controls/native_control_gtk.h b/views/controls/native_control_gtk.h
new file mode 100644
index 0000000..fb766c7
--- /dev/null
+++ b/views/controls/native_control_gtk.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2009 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_GTK_H_
+#define VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_
+
+#include "views/controls/native_view_host_gtk.h"
+
+namespace views {
+
+// A View that hosts a native control.
+class NativeControlGtk : public NativeViewHostGtk {
+ public:
+ NativeControlGtk();
+ virtual ~NativeControlGtk();
+
+ // Overridden from View:
+ virtual void SetEnabled(bool enabled);
+
+ protected:
+ virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child);
+ virtual void VisibilityChanged(View* starting_from, bool is_visible);
+ virtual void Focus();
+
+ // Called when the NativeControlGtk is attached to a View hierarchy with a
+ // valid Widget. The NativeControlGtk should use this opportunity to create
+ // its associated GtkWidget.
+ virtual void CreateNativeControl() = 0;
+
+ // MUST be called by the subclass implementation of |CreateNativeControl|
+ // immediately after creating the control GtkWidget, otherwise it won't be
+ // attached to the GtkView and will be effectively orphaned.
+ virtual void NativeControlCreated(GtkWidget* widget);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NativeControlGtk);
+};
+
+} // namespace views
+
+#endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_