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

Side by Side Diff: views/controls/native_control_gtk.h

Issue 8621006: Remove most obvious TOUCH_UI code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert file that CQ does not like. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/menu/nested_dispatcher_gtk.cc ('k') | views/controls/native_control_gtk.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 (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 OnEnabledChanged(); 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)
29 virtual bool OnMousePressed(const MouseEvent& event);
30 virtual void OnMouseReleased(const MouseEvent& event);
31 virtual void OnMouseMoved(const MouseEvent& event);
32 virtual void OnMouseExited(const MouseEvent& event);
33 virtual void OnMouseEntered(const MouseEvent& event);
34
35 // Fake a mouse event.
36 void FakeNativeMouseEvent(const MouseEvent& event);
37 #endif
38 28
39 // Called when the NativeControlGtk is attached to a View hierarchy with a 29 // Called when the NativeControlGtk is attached to a View hierarchy with a
40 // valid Widget. The NativeControlGtk should use this opportunity to create 30 // valid Widget. The NativeControlGtk should use this opportunity to create
41 // its associated GtkWidget. 31 // its associated GtkWidget.
42 virtual void CreateNativeControl() = 0; 32 virtual void CreateNativeControl() = 0;
43 33
44 // MUST be called by the subclass implementation of |CreateNativeControl| 34 // MUST be called by the subclass implementation of |CreateNativeControl|
45 // immediately after creating the control GtkWidget, otherwise it won't be 35 // immediately after creating the control GtkWidget, otherwise it won't be
46 // attached to the GtkView and will be effectively orphaned. 36 // attached to the GtkView and will be effectively orphaned.
47 virtual void NativeControlCreated(GtkWidget* widget); 37 virtual void NativeControlCreated(GtkWidget* widget);
48 38
49 private: 39 private:
50 static gboolean CallFocusIn(GtkWidget* gtk_widget, 40 static gboolean CallFocusIn(GtkWidget* gtk_widget,
51 GdkEventFocus* event, 41 GdkEventFocus* event,
52 NativeControlGtk* button); 42 NativeControlGtk* button);
53 43
54 DISALLOW_COPY_AND_ASSIGN(NativeControlGtk); 44 DISALLOW_COPY_AND_ASSIGN(NativeControlGtk);
55 }; 45 };
56 46
57 } // namespace views 47 } // namespace views
58 48
59 #endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_ 49 #endif // #ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_
OLDNEW
« no previous file with comments | « views/controls/menu/nested_dispatcher_gtk.cc ('k') | views/controls/native_control_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698