| Index: ash/system/tray/tray_background_view.cc
|
| diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc
|
| index 82078edd5afd8b51418f47ef4c6eb78b0bede41b..703f8aa5a2dc71f4b64aea229b7892a6952f3fef 100644
|
| --- a/ash/system/tray/tray_background_view.cc
|
| +++ b/ash/system/tray/tray_background_view.cc
|
| @@ -7,6 +7,7 @@
|
| #include "ash/root_window_controller.h"
|
| #include "ash/screen_util.h"
|
| #include "ash/shelf/shelf_layout_manager.h"
|
| +#include "ash/shelf/shelf_util.h"
|
| #include "ash/shelf/shelf_widget.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell_window_ids.h"
|
| @@ -191,7 +192,7 @@ void TrayBackgroundView::TrayContainer::ViewHierarchyChanged(
|
| void TrayBackgroundView::TrayContainer::UpdateLayout() {
|
| // Adjust the size of status tray dark background by adding additional
|
| // empty border.
|
| - if (alignment_ == SHELF_ALIGNMENT_BOTTOM) {
|
| + if (IsHorizontalAlignment(alignment_)) {
|
| SetBorder(views::Border::CreateEmptyBorder(
|
| kPaddingFromEdgeOfShelf,
|
| kPaddingFromEdgeOfShelf,
|
| @@ -402,7 +403,7 @@ void TrayBackgroundView::SetTrayBorder() {
|
| // Tray views are laid out right-to-left or bottom-to-top
|
| bool on_edge = (this == parent->child_at(0));
|
| int left_edge, top_edge, right_edge, bottom_edge;
|
| - if (shelf_alignment() == SHELF_ALIGNMENT_BOTTOM) {
|
| + if (IsHorizontalAlignment(shelf_alignment())) {
|
| top_edge = ShelfLayoutManager::kShelfItemInset;
|
| left_edge = 0;
|
| bottom_edge = kShelfSize -
|
| @@ -449,7 +450,7 @@ bool TrayBackgroundView::RequiresNotificationWhenAnimatorDestroyed() const {
|
|
|
| void TrayBackgroundView::HideTransformation() {
|
| gfx::Transform transform;
|
| - if (shelf_alignment_ == SHELF_ALIGNMENT_BOTTOM)
|
| + if (IsHorizontalAlignment(shelf_alignment_))
|
| transform.Translate(width(), 0.0f);
|
| else
|
| transform.Translate(0.0f, height());
|
| @@ -558,15 +559,10 @@ gfx::Rect TrayBackgroundView::GetBubbleAnchorRect(
|
| }
|
|
|
| TrayBubbleView::AnchorAlignment TrayBackgroundView::GetAnchorAlignment() const {
|
| - switch (shelf_alignment_) {
|
| - case SHELF_ALIGNMENT_BOTTOM:
|
| - return TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM;
|
| - case SHELF_ALIGNMENT_LEFT:
|
| - return TrayBubbleView::ANCHOR_ALIGNMENT_LEFT;
|
| - case SHELF_ALIGNMENT_RIGHT:
|
| - return TrayBubbleView::ANCHOR_ALIGNMENT_RIGHT;
|
| - }
|
| - NOTREACHED();
|
| + if (shelf_alignment_ == SHELF_ALIGNMENT_LEFT)
|
| + return TrayBubbleView::ANCHOR_ALIGNMENT_LEFT;
|
| + if (shelf_alignment_ == SHELF_ALIGNMENT_RIGHT)
|
| + return TrayBubbleView::ANCHOR_ALIGNMENT_RIGHT;
|
| return TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM;
|
| }
|
|
|
|
|