OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ | 5 #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ |
6 #define VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ | 6 #define VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
11 #include "views/controls/native/native_view_host.h" | 11 #include "views/controls/native/native_view_host.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 | 14 |
15 // A View that hosts a native control. | 15 // A View that hosts a native control. |
16 class NativeControlGtk : public NativeViewHost { | 16 class NativeControlGtk : public NativeViewHost { |
17 public: | 17 public: |
18 NativeControlGtk(); | 18 NativeControlGtk(); |
19 virtual ~NativeControlGtk(); | 19 virtual ~NativeControlGtk(); |
20 | 20 |
21 // Overridden from View: | 21 // Overridden from View: |
22 virtual void SetEnabled(bool enabled); | 22 virtual void OnEnabledChanged(); |
23 | 23 |
24 protected: | 24 protected: |
25 virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); | 25 virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); |
26 virtual void VisibilityChanged(View* starting_from, bool is_visible); | 26 virtual void VisibilityChanged(View* starting_from, bool is_visible); |
27 virtual void OnFocus(); | 27 virtual void OnFocus(); |
28 #if defined(TOUCH_UI) | 28 #if defined(TOUCH_UI) |
29 virtual bool OnMousePressed(const MouseEvent& event); | 29 virtual bool OnMousePressed(const MouseEvent& event); |
30 virtual void OnMouseReleased(const MouseEvent& event); | 30 virtual void OnMouseReleased(const MouseEvent& event); |
31 virtual void OnMouseMoved(const MouseEvent& event); | 31 virtual void OnMouseMoved(const MouseEvent& event); |
32 virtual void OnMouseExited(const MouseEvent& event); | 32 virtual void OnMouseExited(const MouseEvent& event); |
(...skipping 17 matching lines...) Expand all Loading... |
50 static gboolean CallFocusIn(GtkWidget* widget, | 50 static gboolean CallFocusIn(GtkWidget* widget, |
51 GdkEventFocus* event, | 51 GdkEventFocus* event, |
52 NativeControlGtk* button); | 52 NativeControlGtk* button); |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(NativeControlGtk); | 54 DISALLOW_COPY_AND_ASSIGN(NativeControlGtk); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace views | 57 } // namespace views |
58 | 58 |
59 #endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ | 59 #endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ |
OLD | NEW |