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

Unified Diff: ui/views/controls/tree/tree_view.cc

Issue 1177503003: Remove the 2-level input method system & InputMethodBridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reverted changes for MockInputMethod. Created 5 years, 6 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
Index: ui/views/controls/tree/tree_view.cc
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc
index e3e6194e37dc52d3e3dbf5a6f799efdc1bf2cd07..a59d46fc0a9ea758e318466024b8405b26467de0 100644
--- a/ui/views/controls/tree/tree_view.cc
+++ b/ui/views/controls/tree/tree_view.cc
@@ -9,6 +9,7 @@
#include "base/i18n/rtl.h"
#include "base/message_loop/message_loop.h"
#include "ui/accessibility/ax_view_state.h"
+#include "ui/base/ime/input_method.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
@@ -23,7 +24,6 @@
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/tree/tree_view_controller.h"
-#include "ui/views/ime/input_method.h"
using ui::TreeModel;
using ui::TreeModelNode;
@@ -98,6 +98,8 @@ TreeView::~TreeView() {
focus_manager_->RemoveFocusChangeListener(this);
focus_manager_ = NULL;
}
+ if (GetTextInputClient() && GetInputMethod())
+ GetInputMethod()->DetachTextInputClient(GetTextInputClient());
}
View* TreeView::CreateParentIfNecessary() {
@@ -617,17 +619,19 @@ void TreeView::OnPaint(gfx::Canvas* canvas) {
}
void TreeView::OnFocus() {
- GetInputMethod()->OnFocus();
+ if (GetInputMethod())
+ GetInputMethod()->SetFocusedTextInputClient(GetTextInputClient());
View::OnFocus();
SchedulePaintForNode(selected_node_);
// Notify the InputMethod so that it knows to query the TextInputClient.
if (GetInputMethod())
- GetInputMethod()->OnCaretBoundsChanged(this);
+ GetInputMethod()->OnCaretBoundsChanged(GetTextInputClient());
}
void TreeView::OnBlur() {
- GetInputMethod()->OnBlur();
+ if (GetInputMethod())
+ GetInputMethod()->DetachTextInputClient(GetTextInputClient());
SchedulePaintForNode(selected_node_);
if (selector_)
selector_->OnViewBlur();

Powered by Google App Engine
This is Rietveld 408576698