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

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

Issue 2271483003: Updates the IME list when the IME has refreshed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index 4453ad526b30efb48793162702654a6623ea204a..4835372cb52b3db597c3e7cf65821eb24f1dbcda 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -52,10 +52,10 @@ TrayPopupHeaderButton* CreateImeMenuButton(views::ButtonListener* listener,
int accessible_name_id,
int message_id,
int right_border) {
- TrayPopupHeaderButton* button = new ash::TrayPopupHeaderButton(
- listener, enabled_resource_id, disabled_resource_id,
- enabled_resource_id_hover, disabled_resource_id_hover,
- accessible_name_id);
+ TrayPopupHeaderButton* button =
+ new TrayPopupHeaderButton(listener, enabled_resource_id,
+ disabled_resource_id, enabled_resource_id_hover,
+ disabled_resource_id_hover, accessible_name_id);
button->SetTooltipText(l10n_util::GetStringUTF16(message_id));
button->SetBorder(views::Border::CreateSolidSidedBorder(0, 0, 0, right_border,
kBorderDarkColor));
@@ -152,7 +152,7 @@ ImeMenuTray::~ImeMenuTray() {
void ImeMenuTray::SetShelfAlignment(ShelfAlignment alignment) {
TrayBackgroundView::SetShelfAlignment(alignment);
- if (!ash::MaterialDesignController::IsShelfMaterial())
+ if (!MaterialDesignController::IsShelfMaterial())
tray_container()->SetBorder(views::Border::NullBorder());
}
@@ -179,6 +179,15 @@ bool ImeMenuTray::PerformAction(const ui::Event& event) {
void ImeMenuTray::OnIMERefresh() {
UpdateTrayLabel();
+ if (bubble_ && ime_list_view_) {
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
+ IMEInfoList list;
+ delegate->GetAvailableIMEList(&list);
+ IMEPropertyInfoList property_list;
+ delegate->GetCurrentIMEProperties(&property_list);
+ ime_list_view_->Update(list, property_list, false,
+ ImeListView::SHOW_SINGLE_IME);
+ }
}
void ImeMenuTray::OnIMEMenuActivationChanged(bool is_activated) {
@@ -190,7 +199,6 @@ void ImeMenuTray::OnIMEMenuActivationChanged(bool is_activated) {
}
void ImeMenuTray::BubbleViewDestroyed() {
- SetDrawBackgroundAsActive(false);
}
void ImeMenuTray::OnMouseEnteredView() {}
@@ -261,8 +269,9 @@ void ImeMenuTray::ShowImeMenuBubble() {
bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
// Adds IME list to the bubble.
- bubble_view->AddChildView(
- new ImeListView(nullptr, false, ImeListView::SHOW_SINGLE_IME));
+ ime_list_view_ =
+ new ImeListView(nullptr, false, ImeListView::SHOW_SINGLE_IME);
+ bubble_view->AddChildView(ime_list_view_);
// Adds IME buttons to the bubble if needed.
LoginStatus login =
@@ -271,12 +280,13 @@ void ImeMenuTray::ShowImeMenuBubble() {
!WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen())
bubble_view->AddChildView(new ImeButtonsView(false, false, false, true));
- bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view));
+ bubble_.reset(new TrayBubbleWrapper(this, bubble_view));
SetDrawBackgroundAsActive(true);
}
void ImeMenuTray::HideImeMenuBubble() {
bubble_.reset();
+ ime_list_view_ = nullptr;
SetDrawBackgroundAsActive(false);
}

Powered by Google App Engine
This is Rietveld 408576698