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

Side by Side Diff: views/widget/native_widget_gtk.cc

Issue 7004029: Fix to make InputMethodIBus usable on every ChromeOS device (even without TouchUI) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small fix to replace "if" with "?" Created 9 years, 7 months 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/views.gyp ('k') | no next file » | 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 #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 26 matching lines...) Expand all
37 37
38 #if defined(TOUCH_UI) 38 #if defined(TOUCH_UI)
39 #if defined(HAVE_XINPUT2) 39 #if defined(HAVE_XINPUT2)
40 #include <gdk/gdkx.h> 40 #include <gdk/gdkx.h>
41 41
42 #include "ui/gfx/gtk_util.h" 42 #include "ui/gfx/gtk_util.h"
43 #include "views/touchui/touch_factory.h" 43 #include "views/touchui/touch_factory.h"
44 #endif 44 #endif
45 #endif 45 #endif
46 46
47 #if defined(TOUCH_UI) && defined(HAVE_IBUS) 47 #if defined(HAVE_IBUS)
48 #include "views/ime/input_method_ibus.h" 48 #include "views/ime/input_method_ibus.h"
49 #else 49 #endif
50 #if !defined(TOUCH_UI)
50 #include "views/ime/input_method_gtk.h" 51 #include "views/ime/input_method_gtk.h"
51 #endif 52 #endif
52 53
53 using ui::OSExchangeData; 54 using ui::OSExchangeData;
54 using ui::OSExchangeDataProviderGtk; 55 using ui::OSExchangeDataProviderGtk;
55 using ui::ActiveWindowWatcherX; 56 using ui::ActiveWindowWatcherX;
56 57
57 namespace views { 58 namespace views {
58 59
59 namespace { 60 namespace {
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 613
613 // Make container here. 614 // Make container here.
614 CreateGtkWidget(modified_params); 615 CreateGtkWidget(modified_params);
615 delegate_->OnNativeWidgetCreated(); 616 delegate_->OnNativeWidgetCreated();
616 617
617 // Creates input method for toplevel widget after calling 618 // Creates input method for toplevel widget after calling
618 // delegate_->OnNativeWidgetCreated(), to make sure that focus manager is 619 // delegate_->OnNativeWidgetCreated(), to make sure that focus manager is
619 // already created at this point. 620 // already created at this point.
620 // TODO(suzhe): Always enable input method when we start to use 621 // TODO(suzhe): Always enable input method when we start to use
621 // RenderWidgetHostViewViews in normal ChromeOS. 622 // RenderWidgetHostViewViews in normal ChromeOS.
622 #if defined(TOUCH_UI) && defined(HAVE_IBUS) 623 if (!child_ && NativeTextfieldViews::IsTextfieldViewsEnabled()) {
623 if (!child_) { 624 #if defined(TOUCH_UI)
624 input_method_.reset(new InputMethodIBus(this)); 625 input_method_.reset(new InputMethodIBus(this));
626 #elif defined(HAVE_IBUS)
627 input_method_.reset(InputMethodIBus::IsInputMethodIBusEnabled() ?
628 static_cast<InputMethod*>(new InputMethodIBus(this)) :
629 static_cast<InputMethod*>(new InputMethodGtk(this)));
625 #else 630 #else
626 if (!child_ && NativeTextfieldViews::IsTextfieldViewsEnabled()) {
627 input_method_.reset(new InputMethodGtk(this)); 631 input_method_.reset(new InputMethodGtk(this));
628 #endif 632 #endif
629 input_method_->Init(GetWidget()); 633 input_method_->Init(GetWidget());
630 } 634 }
631 635
632 if (opacity_ != 255) 636 if (opacity_ != 255)
633 SetOpacity(opacity_); 637 SetOpacity(opacity_);
634 638
635 // Make sure we receive our motion events. 639 // Make sure we receive our motion events.
636 640
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 1809
1806 // And now, notify them that they have a brand new parent. 1810 // And now, notify them that they have a brand new parent.
1807 for (NativeWidgets::iterator it = widgets.begin(); 1811 for (NativeWidgets::iterator it = widgets.begin();
1808 it != widgets.end(); ++it) { 1812 it != widgets.end(); ++it) {
1809 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, 1813 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true,
1810 new_parent); 1814 new_parent);
1811 } 1815 }
1812 } 1816 }
1813 1817
1814 } // namespace views 1818 } // namespace views
OLDNEW
« no previous file with comments | « views/views.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698