summaryrefslogtreecommitdiffstats
path: root/ash/shelf
diff options
context:
space:
mode:
authorjonross <jonross@chromium.org>2015-05-28 08:46:06 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-28 15:46:52 +0000
commita1a46a185ec59bf1c0e7eb41d4a5d0b4d0712acd (patch)
tree237884f11c5898f789bb15730d24b6bb84467603 /ash/shelf
parent2d0678b74d76e320dd006dab43ab627bc5c020d4 (diff)
downloadchromium_src-a1a46a185ec59bf1c0e7eb41d4a5d0b4d0712acd.zip
chromium_src-a1a46a185ec59bf1c0e7eb41d4a5d0b4d0712acd.tar.gz
chromium_src-a1a46a185ec59bf1c0e7eb41d4a5d0b4d0712acd.tar.bz2
Have Notifications account for Virtual Keyboard and Dock
Currently Notifications appears behind the Virtual Keyboard. They also do not render over Docked Windows. Update AshPopupAlignmentDelegate calculations of its work area. When windows are docked this reduces the work area for windows. AshPopupAlignmentDelegate uses the work area to determine the positioning of notifications. Update this calculation to include the docked region. Updated ShelfLayoutManager to track the region not occupied by the shelf. In this change that area now also excludes the region of the virtual keyboard. This change reverts the following in order to reland the docked window fix Revert "Revert of Have Notifications appear over docked windows (patchset #4 id:60001 of https://codereview.chromium.org/1121893004/)" This reverts commit d42d4b2b547f8adbc7ac47e3eb20085901217f63. TEST=AshPopupAlignmentDelegateTest.DockedWindow, AshPopupAlignmentDelegateTest.KeyboardShowing BUG=284574, 487631 Review URL: https://codereview.chromium.org/1154383002 Cr-Commit-Position: refs/heads/master@{#331788}
Diffstat (limited to 'ash/shelf')
-rw-r--r--ash/shelf/shelf_layout_manager.cc4
-rw-r--r--ash/shelf/shelf_layout_manager.h11
2 files changed, 15 insertions, 0 deletions
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 7d035c0..e41b349 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -859,6 +859,10 @@ void ShelfLayoutManager::CalculateTargetBounds(
gfx::Rect(0, 0,
shelf_width - status_size.width(),
target_bounds->shelf_bounds_in_root.height()));
+
+ user_work_area_bounds_ = available_bounds;
+ user_work_area_bounds_.Subtract(target_bounds->shelf_bounds_in_root);
+ user_work_area_bounds_.Subtract(keyboard_bounds_);
}
void ShelfLayoutManager::UpdateTargetBoundsForGesture(
diff --git a/ash/shelf/shelf_layout_manager.h b/ash/shelf/shelf_layout_manager.h
index 6f91547..96f405e 100644
--- a/ash/shelf/shelf_layout_manager.h
+++ b/ash/shelf/shelf_layout_manager.h
@@ -121,6 +121,12 @@ class ASH_EXPORT ShelfLayoutManager
// Returns the docked area bounds.
const gfx::Rect& dock_bounds() const { return dock_bounds_; }
+ // Returns the bounds within the root window not occupied by the shelf nor the
+ // virtual keyboard.
+ const gfx::Rect& user_work_area_bounds() const {
+ return user_work_area_bounds_;
+ }
+
// Stops any animations and sets the bounds of the shelf and status
// widgets.
void LayoutShelf();
@@ -214,6 +220,7 @@ class ASH_EXPORT ShelfLayoutManager
private:
class AutoHideEventFilter;
class UpdateShelfObserver;
+ friend class AshPopupAlignmentDelegateTest;
friend class ash::ScreenAsh;
friend class PanelLayoutManagerTest;
friend class ShelfLayoutManagerTest;
@@ -399,6 +406,10 @@ class ASH_EXPORT ShelfLayoutManager
// The bounds of the dock.
gfx::Rect dock_bounds_;
+ // The bounds within the root window not occupied by the shelf nor the virtual
+ // keyboard.
+ gfx::Rect user_work_area_bounds_;
+
// The show hide animation duration override or 0 for default.
int duration_override_in_ms_;