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

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

Issue 2541743004: Set ImeListView's scrollable range when updating (Closed)
Patch Set: Set ImeListView's scrollable range when updating. Created 4 years 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: ash/common/system/chromeos/ime_menu/ime_list_view.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_list_view.cc b/ash/common/system/chromeos/ime_menu/ime_list_view.cc
index 1452eeb447d518398a7e8a9e0cff73c60718c128..93a74c9fdc98c694a51f35a9b56e1f9323fd0e86 100644
--- a/ash/common/system/chromeos/ime_menu/ime_list_view.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_list_view.cc
@@ -5,6 +5,7 @@
#include "ash/common/system/chromeos/ime_menu/ime_list_view.h"
#include "ash/common/material_design/material_design_controller.h"
+#include "ash/common/system/tray/fixed_sized_scroll_view.h"
#include "ash/common/system/tray/hover_highlight_view.h"
#include "ash/common/system/tray/ime_info.h"
#include "ash/common/system/tray/system_menu_button.h"
@@ -252,8 +253,9 @@ class MaterialKeyboardStatusRowView : public views::View {
ImeListView::ImeListView(SystemTrayItem* owner,
bool show_keyboard_toggle,
- SingleImeBehavior single_ime_behavior)
- : TrayDetailsView(owner) {
+ SingleImeBehavior single_ime_behavior,
+ const gfx::Range& scrollable_range)
+ : TrayDetailsView(owner), scrollable_range_(scrollable_range) {
SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
IMEInfoList list;
delegate->GetAvailableIMEList(&list);
@@ -294,13 +296,19 @@ void ImeListView::Update(const IMEInfoList& list,
}
}
+ if (MaterialDesignController::IsSystemTrayMenuMaterial() &&
+ scrollable_range_.IsValid()) {
+ scroller()->ClipHeightTo(scrollable_range_.start(),
+ scrollable_range_.end());
+ }
+
Layout();
tdanderson 2016/12/06 23:38:19 Would it be possible to move the code from lines 2
Azure Wei 2016/12/07 00:58:33 GetImeListViewRange() is kind of opt-in menu speci
SchedulePaint();
}
void ImeListView::ResetImeListView() {
// Children are removed from the view hierarchy and deleted in Reset().
- Reset();
+ TrayDetailsView::Reset();
tdanderson 2016/12/06 23:38:19 Adding TrayDetailsView:: shouldn't be necessary he
Azure Wei 2016/12/07 00:58:33 Reverted.
material_keyboard_status_view_ = nullptr;
keyboard_status_ = nullptr;
}
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_list_view.h ('k') | ash/common/system/chromeos/ime_menu/ime_menu_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698