Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 14477010: Partial fix for keyboard occlusion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gyp fix Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..977655f815fdd609fbda6d240a7130c1f4f239ea 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(),
+ target_bounds->work_area_insets.bottom() + keyboard_bounds_.height(),
+ 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::OnKeyboardBoundsChanging(
+ const gfx::Rect& keyboard_bounds) {
+ keyboard_bounds_ = keyboard_bounds;
+ OnWindowResized();
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698