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 aa3ab2f23ace794786c43d683555bd5b762e6c35..e8cce559e3f94270e67f52352a4fa03ae296e8c0 100644 |
| --- a/ash/shelf/shelf_layout_manager.cc |
| +++ b/ash/shelf/shelf_layout_manager.cc |
| @@ -640,7 +640,7 @@ void ShelfLayoutManager::AdjustBoundsBasedOnAlignment(int inset, |
| void ShelfLayoutManager::CalculateTargetBounds( |
| const State& state, |
| TargetBounds* target_bounds) { |
| - const gfx::Rect& available_bounds(root_window_->bounds()); |
| + const gfx::Rect available_bounds(GetAvailableBounds()); |
| gfx::Rect status_size( |
| shelf_->status_area_widget()->GetWindowBoundsInScreen().size()); |
| int shelf_width = 0, shelf_height = 0; |
| @@ -659,7 +659,8 @@ void ShelfLayoutManager::CalculateTargetBounds( |
| shelf_height = kAutoHideSize; |
| else |
| shelf_width = kAutoHideSize; |
| - } else if (state.visibility_state == SHELF_HIDDEN) { |
| + } else if (state.visibility_state == SHELF_HIDDEN || |
| + !keyboard_bounds_.IsEmpty()) { |
| if (IsHorizontalAlignment()) |
| shelf_height = 0; |
| else |
| @@ -697,6 +698,15 @@ void ShelfLayoutManager::CalculateTargetBounds( |
| gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)), |
| gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0)); |
| + // Also push in the work area inset for the keyboard if it is visible. |
| + if (!keyboard_bounds_.IsEmpty()) { |
| + target_bounds->work_area_insets.Set( |
| + target_bounds->work_area_insets.top(), |
| + target_bounds->work_area_insets.left(), |
| + keyboard_bounds_.height(), |
|
sadrul
2013/04/26 02:54:16
If you set bottom to:
keyboard_bounds_.height()
bryeung
2013/04/26 13:44:50
When the keyboard is showing, work_area_inserts.bo
|
| + target_bounds->work_area_insets.right()); |
| + } |
| + |
| target_bounds->opacity = |
| (gesture_drag_status_ != GESTURE_DRAG_NONE || |
| state.visibility_state == SHELF_VISIBLE || |
| @@ -913,5 +923,17 @@ int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
| return 0; |
| } |
| +gfx::Rect ShelfLayoutManager::GetAvailableBounds() const { |
| + gfx::Rect bounds(root_window_->bounds()); |
| + bounds.set_height(bounds.height() - keyboard_bounds_.height()); |
| + return bounds; |
| +} |
| + |
| +void ShelfLayoutManager::OnKeyboardBoundsChanged( |
| + const gfx::Rect& keyboard_bounds) { |
| + keyboard_bounds_ = keyboard_bounds; |
| + OnWindowResized(); |
| +} |
| + |
| } // namespace internal |
| } // namespace ash |