| 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 // RenderWidgetHostViewViews in normal ChromeOS. | 966 // RenderWidgetHostViewViews in normal ChromeOS. |
| 967 if (views::Widget::IsPureViews()) { | 967 if (views::Widget::IsPureViews()) { |
| 968 #if defined(HAVE_IBUS) | 968 #if defined(HAVE_IBUS) |
| 969 InputMethod* input_method = | 969 InputMethod* input_method = |
| 970 InputMethodIBus::IsInputMethodIBusEnabled() ? | 970 InputMethodIBus::IsInputMethodIBusEnabled() ? |
| 971 static_cast<InputMethod*>(new InputMethodIBus(this)) : | 971 static_cast<InputMethod*>(new InputMethodIBus(this)) : |
| 972 static_cast<InputMethod*>(new InputMethodGtk(this)); | 972 static_cast<InputMethod*>(new InputMethodGtk(this)); |
| 973 #else | 973 #else |
| 974 InputMethod* input_method = new InputMethodGtk(this); | 974 InputMethod* input_method = new InputMethodGtk(this); |
| 975 #endif | 975 #endif |
| 976 input_method->Init(GetWidget()); |
| 976 if (has_focus_) | 977 if (has_focus_) |
| 977 input_method->OnFocus(); | 978 input_method->OnFocus(); |
| 978 return input_method; | 979 return input_method; |
| 979 } | 980 } |
| 980 // GTK's textfield handles IME. | 981 // GTK's textfield handles IME. |
| 981 return NULL; | 982 return NULL; |
| 982 } | 983 } |
| 983 | 984 |
| 984 void NativeWidgetGtk::CenterWindow(const gfx::Size& size) { | 985 void NativeWidgetGtk::CenterWindow(const gfx::Size& size) { |
| 985 gfx::Rect center_rect; | 986 gfx::Rect center_rect; |
| (...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 button_pressed = event->type == GDK_BUTTON_PRESS || | 2245 button_pressed = event->type == GDK_BUTTON_PRESS || |
| 2245 event->type == GDK_2BUTTON_PRESS || | 2246 event->type == GDK_2BUTTON_PRESS || |
| 2246 event->type == GDK_3BUTTON_PRESS; | 2247 event->type == GDK_3BUTTON_PRESS; |
| 2247 gdk_event_free(event); | 2248 gdk_event_free(event); |
| 2248 } | 2249 } |
| 2249 return button_pressed; | 2250 return button_pressed; |
| 2250 } | 2251 } |
| 2251 | 2252 |
| 2252 } // namespace internal | 2253 } // namespace internal |
| 2253 } // namespace views | 2254 } // namespace views |
| OLD | NEW |