Chromium Code Reviews| Index: ash/shelf/shelf_view.cc |
| diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc |
| index d59ff70ae5017f478bb676ccea6c496387cdf5de..bca28a97861ff024091335ae313d790263adcad1 100644 |
| --- a/ash/shelf/shelf_view.cc |
| +++ b/ash/shelf/shelf_view.cc |
| @@ -833,12 +833,24 @@ void ShelfView::CalculateIdealBounds(IdealBounds* bounds) const { |
| return; |
| } |
| + // IME menu icon. |
|
sky
2016/05/20 16:23:39
This comment isn't helpful. It should describe wha
Azure Wei
2016/05/24 07:21:16
Updated.
|
| + int last_item_index = view_model_->view_size() - 1; |
| + bool is_last_item_menu = |
|
sky
2016/05/20 16:23:39
is_last_item_ime_menu
Azure Wei
2016/05/24 07:21:16
Done.
|
| + (last_item_index >= 0) && |
| + (model_->items()[last_item_index].type == TYPE_IME_MENU); |
| + if (is_last_item_menu) { |
| + x = shelf_->PrimaryAxisValue(available_size - w, 0); |
| + y = shelf_->PrimaryAxisValue(0, available_size - h); |
| + view_model_->set_ideal_bounds(last_item_index, gfx::Rect(x, y, w, h)); |
| + --last_item_index; |
| + available_size = shelf_->PrimaryAxisValue(x, y); |
| + } |
| + |
| // Right aligned icons. |
| int end_position = available_size - button_spacing; |
| x = shelf_->PrimaryAxisValue(end_position, 0); |
| y = shelf_->PrimaryAxisValue(0, end_position); |
| - for (int i = view_model_->view_size() - 1; |
| - i >= first_panel_index; --i) { |
| + for (int i = last_item_index; i >= first_panel_index; --i) { |
| x = shelf_->PrimaryAxisValue(x - w - button_spacing, x); |
| y = shelf_->PrimaryAxisValue(y, y - h - button_spacing); |
| view_model_->set_ideal_bounds(i, gfx::Rect(x, y, w, h)); |