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

Unified Diff: ash/system/ime_menu/ime_list_view.cc

Issue 2831023003: Refactor AddScrollListItem() in system menu detailed views (Closed)
Patch Set: Rebased Created 3 years, 8 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 | « ash/system/ime_menu/ime_list_view.h ('k') | ash/system/network/network_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ash/system/ime_menu/ime_list_view.h ('k') | ash/system/network/network_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698