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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 9350005: Call CancelComposition() in SaveStateToTab(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698