Index: ash/shelf/shelf_layout_manager.cc |
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
index f13ea079023459d5b94dccd053abe87324ffcd63..1988f20b4237f389f546e659adf6b34bb201ffab 100644 |
--- a/ash/shelf/shelf_layout_manager.cc |
+++ b/ash/shelf/shelf_layout_manager.cc |
@@ -96,16 +96,8 @@ const int ShelfLayoutManager::kWorkspaceAreaAutoHideInset = 5; |
const int ShelfLayoutManager::kAutoHideSize = 3; |
// static |
-const int ShelfLayoutManager::kShelfSize = 47; |
- |
-// static |
const int ShelfLayoutManager::kShelfItemInset = 3; |
-int ShelfLayoutManager::GetPreferredShelfSize() { |
- return ash::switches::UseAlternateShelfLayout() ? |
- ShelfLayoutManager::kShelfSize : kShelfPreferredSize; |
-} |
- |
// ShelfLayoutManager::AutoHideEventFilter ------------------------------------- |
// Notifies ShelfLayoutManager any time the mouse moves. |
@@ -736,9 +728,9 @@ void ShelfLayoutManager::GetShelfSize(int* width, int* height) { |
gfx::Size status_size( |
shelf_->status_area_widget()->GetWindowBoundsInScreen().size()); |
if (IsHorizontalAlignment()) |
- *height = GetPreferredShelfSize(); |
+ *height = kShelfSize; |
else |
- *width = GetPreferredShelfSize(); |
+ *width = kShelfSize; |
} |
void ShelfLayoutManager::AdjustBoundsBasedOnAlignment(int inset, |
@@ -790,16 +782,11 @@ void ShelfLayoutManager::CalculateTargetBounds( |
gfx::Rect(available_bounds.x(), available_bounds.y(), |
available_bounds.width(), shelf_height)); |
- int status_inset = std::max(0, GetPreferredShelfSize() - |
- PrimaryAxisValue(status_size.height(), status_size.width())); |
- |
- if (ash::switches::UseAlternateShelfLayout()) { |
- status_inset = 0; |
- if (IsHorizontalAlignment()) |
- status_size.set_height(kShelfSize); |
- else |
- status_size.set_width(kShelfSize); |
- } |
+ int status_inset = 0; |
+ if (IsHorizontalAlignment()) |
+ status_size.set_height(kShelfSize); |
+ else |
+ status_size.set_width(kShelfSize); |
target_bounds->status_bounds_in_shelf = SelectValueForShelfAlignment( |
gfx::Rect(base::i18n::IsRTL() ? 0 : shelf_width - status_size.width(), |
@@ -879,7 +866,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture( |
// changed since then, e.g. because the tray-menu was shown because of the |
// drag), then allow the drag some resistance-free region at first to make |
// sure the shelf sticks with the finger until the shelf is visible. |
- resistance_free_region = GetPreferredShelfSize() - kAutoHideSize; |
+ resistance_free_region = kShelfSize - kAutoHideSize; |
} |
bool resist = SelectValueForShelfAlignment( |
@@ -910,16 +897,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture( |
available_bounds.bottom() - shelf_height); |
} |
- if (ash::switches::UseAlternateShelfLayout()) { |
- target_bounds->status_bounds_in_shelf.set_y(0); |
- } 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()); |
- } |
+ target_bounds->status_bounds_in_shelf.set_y(0); |
} else { |
// Move and size the shelf with the gesture. |
int shelf_width = target_bounds->shelf_bounds_in_root.width(); |
@@ -935,21 +913,12 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture( |
available_bounds.right() - shelf_width); |
} |
- if (ash::switches::UseAlternateShelfLayout()) { |
- if (right_aligned) |
- target_bounds->status_bounds_in_shelf.set_x(0); |
- else |
- target_bounds->status_bounds_in_shelf.set_x( |
- target_bounds->shelf_bounds_in_root.width() - |
- kShelfSize); |
- } 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()); |
- } |
+ if (right_aligned) |
+ target_bounds->status_bounds_in_shelf.set_x(0); |
+ else |
+ target_bounds->status_bounds_in_shelf.set_x( |
+ target_bounds->shelf_bounds_in_root.width() - |
+ kShelfSize); |
} |
} |