Index: ash/system/ime_menu/ime_list_view.cc |
diff --git a/ash/system/ime_menu/ime_list_view.cc b/ash/system/ime_menu/ime_list_view.cc |
index 334b42ece1673935fbd7a8346be65f81c9d33a8a..4d9cf07ade0cb4b146108ca996e8c3368df5b45f 100644 |
--- a/ash/system/ime_menu/ime_list_view.cc |
+++ b/ash/system/ime_menu/ime_list_view.cc |
@@ -112,8 +112,8 @@ class ImeListItemView : public ActionableView { |
void OnFocus() override { |
ActionableView::OnFocus(); |
- if (ime_list_view_ && ime_list_view_->scroll_content()) |
- ime_list_view_->scroll_content()->ScrollRectToVisible(bounds()); |
+ if (ime_list_view_) |
+ ime_list_view_->ScrollItemToVisible(this); |
} |
void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
@@ -221,7 +221,7 @@ void ImeListView::Update(const IMEInfoList& list, |
last_item_selected_with_keyboard_) { |
FocusCurrentImeIfNeeded(); |
} else if (current_ime_view_) { |
- scroll_content()->ScrollRectToVisible(current_ime_view_->bounds()); |
+ ScrollItemToVisible(current_ime_view_); |
} |
} |
@@ -232,6 +232,11 @@ void ImeListView::ResetImeListView() { |
current_ime_view_ = nullptr; |
} |
+void ImeListView::ScrollItemToVisible(views::View* item_view) { |
+ if (scroll_content()) |
+ scroll_content()->ScrollRectToVisible(item_view->bounds()); |
+} |
+ |
void ImeListView::CloseImeListView() { |
last_selected_item_id_.clear(); |
current_ime_view_ = nullptr; |
@@ -324,7 +329,7 @@ void ImeListView::VisibilityChanged(View* starting_from, bool is_visible) { |
return; |
} |
- scroll_content()->ScrollRectToVisible(current_ime_view_->bounds()); |
+ ScrollItemToVisible(current_ime_view_); |
} |
void ImeListView::FocusCurrentImeIfNeeded() { |