| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/gtk_im_context_wrapper.h" | 5 #include "content/browser/renderer_host/gtk_im_context_wrapper.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 RenderWidgetHostImpl::From( | 477 RenderWidgetHostImpl::From( |
| 478 host_view_->GetRenderWidgetHost())->ImeConfirmComposition(); | 478 host_view_->GetRenderWidgetHost())->ImeConfirmComposition(); |
| 479 } | 479 } |
| 480 | 480 |
| 481 // Reset the input method. | 481 // Reset the input method. |
| 482 CancelComposition(); | 482 CancelComposition(); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 void GtkIMContextWrapper::HandleCommit(const string16& text) { | 486 void GtkIMContextWrapper::HandleCommit(const string16& text) { |
| 487 if (suppress_next_commit_) { | 487 if (suppress_next_commit_) |
| 488 suppress_next_commit_ = false; | |
| 489 return; | 488 return; |
| 490 } | |
| 491 | 489 |
| 492 // Append the text to the buffer, because commit signal might be fired | 490 // Append the text to the buffer, because commit signal might be fired |
| 493 // multiple times when processing a key event. | 491 // multiple times when processing a key event. |
| 494 commit_text_.append(text); | 492 commit_text_.append(text); |
| 495 // Nothing needs to do, if it's currently in ProcessKeyEvent() | 493 // Nothing needs to do, if it's currently in ProcessKeyEvent() |
| 496 // handler, which will send commit text to webkit later. Otherwise, | 494 // handler, which will send commit text to webkit later. Otherwise, |
| 497 // we need send it here. | 495 // we need send it here. |
| 498 // It's possible that commit signal is fired without a key event, for | 496 // It's possible that commit signal is fired without a key event, for |
| 499 // example when user input via a voice or handwriting recognition software. | 497 // example when user input via a voice or handwriting recognition software. |
| 500 // In this case, the text must be committed directly. | 498 // In this case, the text must be committed directly. |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 GtkWidget* widget, GtkIMContextWrapper* self) { | 653 GtkWidget* widget, GtkIMContextWrapper* self) { |
| 656 self->HandleHostViewRealize(widget); | 654 self->HandleHostViewRealize(widget); |
| 657 } | 655 } |
| 658 | 656 |
| 659 void GtkIMContextWrapper::HandleHostViewUnrealizeThunk( | 657 void GtkIMContextWrapper::HandleHostViewUnrealizeThunk( |
| 660 GtkWidget* widget, GtkIMContextWrapper* self) { | 658 GtkWidget* widget, GtkIMContextWrapper* self) { |
| 661 self->HandleHostViewUnrealize(); | 659 self->HandleHostViewUnrealize(); |
| 662 } | 660 } |
| 663 | 661 |
| 664 } // namespace content | 662 } // namespace content |
| OLD | NEW |