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

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: . 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 f103df827570fbe3da267be2f7cf303ff9c79dd7..ce6ea25f8c0e446d521c1c29c2ab3c6f3fa5289b 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"
#include "ui/views/resources/grit/views_resources.h"
using ui::TreeModel;
@@ -370,12 +370,6 @@ bool TreeView::OnMousePressed(const ui::MouseEvent& event) {
return OnClickOrTap(event);
}
-ui::TextInputClient* TreeView::GetTextInputClient() {
- if (!selector_)
- selector_.reset(new PrefixSelector(this));
- return selector_.get();
-}
-
void TreeView::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP) {
if (OnClickOrTap(*event))
@@ -618,17 +612,19 @@ void TreeView::OnPaint(gfx::Canvas* canvas) {
}
void TreeView::OnFocus() {
- GetInputMethod()->OnFocus();
+ if (GetInputMethod())
+ GetInputMethod()->SetFocusedTextInputClient(GetPrefixSelector());
View::OnFocus();
SchedulePaintForNode(selected_node_);
// Notify the InputMethod so that it knows to query the TextInputClient.
if (GetInputMethod())
- GetInputMethod()->OnCaretBoundsChanged(this);
+ GetInputMethod()->OnCaretBoundsChanged(GetPrefixSelector());
}
void TreeView::OnBlur() {
- GetInputMethod()->OnBlur();
+ if (GetInputMethod())
+ GetInputMethod()->DetachTextInputClient(GetPrefixSelector());
SchedulePaintForNode(selected_node_);
if (selector_)
selector_->OnViewBlur();
@@ -1003,6 +999,12 @@ bool TreeView::ExpandImpl(TreeModelNode* model_node) {
return return_value;
}
+PrefixSelector* TreeView::GetPrefixSelector() {
+ if (!selector_)
+ selector_.reset(new PrefixSelector(this));
+ return selector_.get();
+}
+
// InternalNode ----------------------------------------------------------------
TreeView::InternalNode::InternalNode()

Powered by Google App Engine
This is Rietveld 408576698