OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/shelf/overflow_button.h" | 5 #include "ash/shelf/overflow_button.h" |
6 | 6 |
7 #include "ash/resources/vector_icons/vector_icons.h" | 7 #include "ash/resources/vector_icons/vector_icons.h" |
8 #include "ash/shelf/shelf_constants.h" | 8 #include "ash/shelf/shelf_constants.h" |
9 #include "ash/shelf/shelf_view.h" | 9 #include "ash/shelf/shelf_view.h" |
10 #include "ash/shelf/wm_shelf.h" | 10 #include "ash/shelf/wm_shelf.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 *chevron_image_, | 164 *chevron_image_, |
165 bounds.x() + ((bounds.width() - chevron_image_->width()) / 2), | 165 bounds.x() + ((bounds.width() - chevron_image_->width()) / 2), |
166 bounds.y() + ((bounds.height() - chevron_image_->height()) / 2)); | 166 bounds.y() + ((bounds.height() - chevron_image_->height()) / 2)); |
167 } | 167 } |
168 | 168 |
169 gfx::Rect OverflowButton::CalculateButtonBounds() const { | 169 gfx::Rect OverflowButton::CalculateButtonBounds() const { |
170 ShelfAlignment alignment = wm_shelf_->GetAlignment(); | 170 ShelfAlignment alignment = wm_shelf_->GetAlignment(); |
171 gfx::Rect content_bounds = GetContentsBounds(); | 171 gfx::Rect content_bounds = GetContentsBounds(); |
172 // Align the button to the top of a bottom-aligned shelf, to the right edge | 172 // Align the button to the top of a bottom-aligned shelf, to the right edge |
173 // a left-aligned shelf, and to the left edge of a right-aligned shelf. | 173 // a left-aligned shelf, and to the left edge of a right-aligned shelf. |
174 const int inset = (GetShelfConstant(SHELF_SIZE) - kOverflowButtonSize) / 2; | 174 const int inset = (kShelfSize - kOverflowButtonSize) / 2; |
175 const int x = alignment == SHELF_ALIGNMENT_LEFT | 175 const int x = alignment == SHELF_ALIGNMENT_LEFT |
176 ? content_bounds.right() - inset - kOverflowButtonSize | 176 ? content_bounds.right() - inset - kOverflowButtonSize |
177 : content_bounds.x() + inset; | 177 : content_bounds.x() + inset; |
178 return gfx::Rect(x, content_bounds.y() + inset, kOverflowButtonSize, | 178 return gfx::Rect(x, content_bounds.y() + inset, kOverflowButtonSize, |
179 kOverflowButtonSize); | 179 kOverflowButtonSize); |
180 } | 180 } |
181 | 181 |
182 } // namespace ash | 182 } // namespace ash |
OLD | NEW |