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 #include "views/widget/native_widget_gtk.h" | 5 #include "views/widget/native_widget_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
10 #include <X11/Xatom.h> | 10 #include <X11/Xatom.h> |
(...skipping 27 matching lines...) Expand all Loading... | |
38 | 38 |
39 #if defined(TOUCH_UI) | 39 #if defined(TOUCH_UI) |
40 #if defined(HAVE_XINPUT2) | 40 #if defined(HAVE_XINPUT2) |
41 #include <gdk/gdkx.h> | 41 #include <gdk/gdkx.h> |
42 | 42 |
43 #include "ui/gfx/gtk_util.h" | 43 #include "ui/gfx/gtk_util.h" |
44 #include "views/touchui/touch_factory.h" | 44 #include "views/touchui/touch_factory.h" |
45 #endif | 45 #endif |
46 #endif | 46 #endif |
47 | 47 |
48 #if defined(TOUCH_UI) && defined(HAVE_IBUS) | 48 #if defined(HAVE_IBUS) |
oshima
2011/05/20 21:47:31
this change adds gtk impl to touch. could you plea
| |
49 #include "views/ime/input_method_ibus.h" | 49 #include "views/ime/input_method_ibus.h" |
50 #else | 50 #endif |
51 #include "views/ime/input_method_gtk.h" | 51 #include "views/ime/input_method_gtk.h" |
52 #endif | |
53 | 52 |
54 using ui::OSExchangeData; | 53 using ui::OSExchangeData; |
55 using ui::OSExchangeDataProviderGtk; | 54 using ui::OSExchangeDataProviderGtk; |
56 using ui::ActiveWindowWatcherX; | 55 using ui::ActiveWindowWatcherX; |
57 | 56 |
58 namespace views { | 57 namespace views { |
59 | 58 |
60 namespace { | 59 namespace { |
61 | 60 |
62 // Links the GtkWidget to its NativeWidget. | 61 // Links the GtkWidget to its NativeWidget. |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
613 | 612 |
614 // Make container here. | 613 // Make container here. |
615 CreateGtkWidget(modified_params); | 614 CreateGtkWidget(modified_params); |
616 delegate_->OnNativeWidgetCreated(); | 615 delegate_->OnNativeWidgetCreated(); |
617 | 616 |
618 // Creates input method for toplevel widget after calling | 617 // Creates input method for toplevel widget after calling |
619 // delegate_->OnNativeWidgetCreated(), to make sure that focus manager is | 618 // delegate_->OnNativeWidgetCreated(), to make sure that focus manager is |
620 // already created at this point. | 619 // already created at this point. |
621 // TODO(suzhe): Always enable input method when we start to use | 620 // TODO(suzhe): Always enable input method when we start to use |
622 // RenderWidgetHostViewViews in normal ChromeOS. | 621 // RenderWidgetHostViewViews in normal ChromeOS. |
623 #if defined(TOUCH_UI) && defined(HAVE_IBUS) | 622 if (!child_ && NativeTextfieldViews::IsTextfieldViewsEnabled()) { |
624 if (!child_) { | 623 #if defined(HAVE_IBUS) |
625 input_method_.reset(new InputMethodIBus(this)); | 624 if(InputMethodIBus::IsInputMethodIBusEnabled()) { |
625 input_method_.reset(new InputMethodIBus(this)); | |
626 } | |
627 else { | |
628 input_method_.reset(new InputMethodGtk(this)); | |
629 } | |
626 #else | 630 #else |
627 if (!child_ && NativeTextfieldViews::IsTextfieldViewsEnabled()) { | |
628 input_method_.reset(new InputMethodGtk(this)); | 631 input_method_.reset(new InputMethodGtk(this)); |
629 #endif | 632 #endif |
630 input_method_->Init(GetWidget()); | 633 input_method_->Init(GetWidget()); |
631 } | 634 } |
632 | 635 |
633 if (opacity_ != 255) | 636 if (opacity_ != 255) |
634 SetOpacity(opacity_); | 637 SetOpacity(opacity_); |
635 | 638 |
636 // Make sure we receive our motion events. | 639 // Make sure we receive our motion events. |
637 | 640 |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1805 | 1808 |
1806 // And now, notify them that they have a brand new parent. | 1809 // And now, notify them that they have a brand new parent. |
1807 for (NativeWidgets::iterator it = widgets.begin(); | 1810 for (NativeWidgets::iterator it = widgets.begin(); |
1808 it != widgets.end(); ++it) { | 1811 it != widgets.end(); ++it) { |
1809 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1812 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
1810 new_parent); | 1813 new_parent); |
1811 } | 1814 } |
1812 } | 1815 } |
1813 | 1816 |
1814 } // namespace views | 1817 } // namespace views |
OLD | NEW |