Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
index 3710bfd6bc0b8902cabe3c5f4489c3df531092c8..83d518210586dab28e977fcc6a29380d5c7fd1b4 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
@@ -38,6 +38,7 @@ |
#include "ui/views/border.h" |
#include "ui/views/controls/textfield/textfield.h" |
#include "ui/views/events/event.h" |
+#include "ui/views/ime/input_method.h" |
#include "ui/views/layout/fill_layout.h" |
#include "ui/views/views_delegate.h" |
@@ -376,13 +377,10 @@ void OmniboxViewViews::SaveStateToTab(WebContents* tab) { |
// We don't want to keep the IME status, so force quit the current |
// session here. It may affect the selection status, so order is |
// also important. |
- // This actually doesn't notify any events to the input method, but |
- // further call of SetText() will notify the current status, so |
- // that's fine. |
- // TODO(mukai): Add a method to InputMethod class to deal with such |
- // situation. http://crbug.com/111578 |
- if (textfield_->IsIMEComposing()) |
+ if (textfield_->IsIMEComposing()) { |
textfield_->GetTextInputClient()->ConfirmCompositionText(); |
+ textfield_->GetInputMethod()->CancelComposition(textfield_); |
+ } |
// NOTE: GetStateForTabSwitch may affect GetSelection, so order is important. |
AutocompleteEditModel::State model_state = model_->GetStateForTabSwitch(); |