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

Unified Diff: ash/shelf/shelf_view.cc

Issue 1996563002: Add ImeMenuTray element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index d59ff70ae5017f478bb676ccea6c496387cdf5de..80491d61bf48c21e8966671f6f7f27dd5f1a1877 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -833,12 +833,23 @@ void ShelfView::CalculateIdealBounds(IdealBounds* bounds) const {
return;
}
+ // IME menu icon.
+ int last_item_index = view_model_->view_size() - 1;
sky 2016/05/19 16:32:48 Might view_size be 0 at this point?
Azure Wei 2016/05/20 01:08:58 Added the check of |last_item_index|.
+ bool is_last_item_menu =
+ 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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698