Index: ash/shelf/shelf_layout_manager.cc |
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
index 82f2b209524ee96ee3f022919f7ad8158f8f944d..bc4428ee8e641492d77a0091e0e21a12a2e7d347 100644 |
--- a/ash/shelf/shelf_layout_manager.cc |
+++ b/ash/shelf/shelf_layout_manager.cc |
@@ -60,6 +60,9 @@ const int kAutoHideDelayMS = 200; |
// keep the shelf from hiding. |
const int kNotificationBubbleGapHeight = 6; |
+// Const inset from the edget of the shelf to the edget of the status area. |
+const int kStatusAreaInset = 3; |
+ |
ui::Layer* GetLayer(views::Widget* widget) { |
return widget->GetNativeView()->layer(); |
} |
@@ -730,6 +733,9 @@ void ShelfLayoutManager::CalculateTargetBounds( |
int status_inset = std::max(0, GetPreferredShelfSize() - |
PrimaryAxisValue(status_size.height(), status_size.width())); |
+ if (ash::switches::UseAlternateShelfLayout()) |
+ status_inset = kStatusAreaInset; |
+ |
target_bounds->status_bounds_in_shelf = SelectValueForShelfAlignment( |
gfx::Rect(base::i18n::IsRTL() ? 0 : shelf_width - status_size.width(), |
status_inset, status_size.width(), status_size.height()), |
@@ -838,12 +844,16 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture( |
available_bounds.bottom() - shelf_height); |
} |
- // The statusbar should be in the center of the shelf. |
- gfx::Rect status_y = target_bounds->shelf_bounds_in_root; |
- status_y.set_y(0); |
- status_y.ClampToCenteredSize( |
- target_bounds->status_bounds_in_shelf.size()); |
- target_bounds->status_bounds_in_shelf.set_y(status_y.y()); |
+ if (ash::switches::UseAlternateShelfLayout()) { |
+ target_bounds->status_bounds_in_shelf.set_y(kStatusAreaInset); |
+ } else { |
+ // The statusbar should be in the center of the shelf. |
+ gfx::Rect status_y = target_bounds->shelf_bounds_in_root; |
+ status_y.set_y(0); |
+ status_y.ClampToCenteredSize( |
+ target_bounds->status_bounds_in_shelf.size()); |
+ target_bounds->status_bounds_in_shelf.set_y(status_y.y()); |
+ } |
} else { |
// Move and size the launcher with the gesture. |
int shelf_width = target_bounds->shelf_bounds_in_root.width(); |
@@ -858,12 +868,21 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture( |
available_bounds.right() - shelf_width); |
} |
- // The statusbar should be in the center of the shelf. |
- gfx::Rect status_x = target_bounds->shelf_bounds_in_root; |
- status_x.set_x(0); |
- status_x.ClampToCenteredSize( |
- target_bounds->status_bounds_in_shelf.size()); |
- target_bounds->status_bounds_in_shelf.set_x(status_x.x()); |
+ if (ash::switches::UseAlternateShelfLayout()) { |
+ if (alignment_ == SHELF_ALIGNMENT_RIGHT) { |
+ target_bounds->shelf_bounds_in_root.set_x( |
+ available_bounds.right() - shelf_width + kStatusAreaInset); |
+ } else { |
+ target_bounds->shelf_bounds_in_root.set_x(kStatusAreaInset); |
+ } |
+ } else { |
+ // The statusbar should be in the center of the shelf. |
+ gfx::Rect status_x = target_bounds->shelf_bounds_in_root; |
+ status_x.set_x(0); |
+ status_x.ClampToCenteredSize( |
+ target_bounds->status_bounds_in_shelf.size()); |
+ target_bounds->status_bounds_in_shelf.set_x(status_x.x()); |
+ } |
} |
} |