Chromium Code Reviews| Index: ash/shelf/shelf_layout_manager.cc |
| diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
| index ff95424866e43eb71462d8b27f3d071040a14ef6..697ccbd61fa33c7fbc034edde6a8204da819d09d 100644 |
| --- a/ash/shelf/shelf_layout_manager.cc |
| +++ b/ash/shelf/shelf_layout_manager.cc |
| @@ -86,18 +86,6 @@ ui::Layer* GetLayer(views::Widget* widget) { |
| } // namespace |
| -// static |
| -const int ShelfLayoutManager::kWorkspaceAreaVisibleInset = 2; |
| - |
| -// static |
| -const int ShelfLayoutManager::kWorkspaceAreaAutoHideInset = 5; |
| - |
| -// static |
| -const int ShelfLayoutManager::kAutoHideSize = 3; |
| - |
| -// static |
| -const int ShelfLayoutManager::kShelfItemInset = 3; |
| - |
| // ShelfLayoutManager::AutoHideEventFilter ------------------------------------- |
| // Notifies ShelfLayoutManager any time the mouse moves. |
| @@ -283,10 +271,12 @@ bool ShelfLayoutManager::IsVisible() const { |
| gfx::Rect ShelfLayoutManager::GetIdealBounds() { |
| gfx::Rect rect(ScreenUtil::GetDisplayBoundsInParent(shelf_->GetNativeView())); |
| return SelectValueForShelfAlignment( |
| - gfx::Rect(rect.x(), rect.bottom() - kShelfSize, rect.width(), kShelfSize), |
| - gfx::Rect(rect.x(), rect.y(), kShelfSize, rect.height()), |
| - gfx::Rect(rect.right() - kShelfSize, rect.y(), kShelfSize, |
| - rect.height())); |
| + gfx::Rect(rect.x(), rect.bottom() - GetShelfLayoutConstant(SHELF_SIZE), |
|
tdanderson
2016/06/03 19:25:23
nit: use const int shelf_size = GetShelfLayoutCons
yiyix
2016/06/10 19:26:04
Done.
|
| + rect.width(), GetShelfLayoutConstant(SHELF_SIZE)), |
| + gfx::Rect(rect.x(), rect.y(), GetShelfLayoutConstant(SHELF_SIZE), |
| + rect.height()), |
| + gfx::Rect(rect.right() - GetShelfLayoutConstant(SHELF_SIZE), rect.y(), |
| + GetShelfLayoutConstant(SHELF_SIZE), rect.height())); |
| } |
| void ShelfLayoutManager::LayoutShelf() { |
| @@ -737,7 +727,7 @@ void ShelfLayoutManager::StopAnimating() { |
| void ShelfLayoutManager::CalculateTargetBounds(const State& state, |
| TargetBounds* target_bounds) { |
| - int shelf_size = kShelfSize; |
| + int shelf_size = GetShelfLayoutConstant(SHELF_SIZE); |
| if (state.visibility_state == SHELF_AUTO_HIDE && |
| state.auto_hide_state == SHELF_AUTO_HIDE_HIDDEN) { |
| // Auto-hidden shelf always starts with the default size. If a gesture-drag |
| @@ -770,9 +760,9 @@ void ShelfLayoutManager::CalculateTargetBounds(const State& state, |
| gfx::Size status_size( |
| shelf_->status_area_widget()->GetWindowBoundsInScreen().size()); |
| if (IsHorizontalAlignment()) |
| - status_size.set_height(kShelfSize); |
| + status_size.set_height(GetShelfLayoutConstant(SHELF_SIZE)); |
| else |
| - status_size.set_width(kShelfSize); |
| + status_size.set_width(GetShelfLayoutConstant(SHELF_SIZE)); |
| gfx::Point status_origin = SelectValueForShelfAlignment( |
| gfx::Point(0, 0), |
| @@ -856,7 +846,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 = kShelfSize - kAutoHideSize; |
| + resistance_free_region = GetShelfLayoutConstant(SHELF_SIZE) - kAutoHideSize; |
| } |
| bool resist = SelectValueForShelfAlignment( |
| @@ -907,7 +897,7 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture( |
| else |
| target_bounds->status_bounds_in_shelf.set_x( |
| target_bounds->shelf_bounds_in_root.width() - |
| - kShelfSize); |
| + GetShelfLayoutConstant(SHELF_SIZE)); |
|
tdanderson
2016/06/03 19:25:23
I know you didn't add this if/else, but since the
yiyix
2016/06/10 19:26:04
Done.
|
| } |
| } |