Commit 33298d59 authored by Andre Le's avatar Andre Le Committed by Commit Bot

ash: Fix popup notification position when hotseat changes.

BUG=1024108d

Change-Id: Ied2848a9241c1cad8db77562498e126f5ce3b429
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291210
Commit-Queue: Andre Le <leandre@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#787867}
parent bd891860
......@@ -9,6 +9,7 @@
#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
#include "ash/shelf/hotseat_widget.h"
#include "ash/shelf/shelf.h"
#include "ash/shell.h"
#include "ash/system/message_center/fullscreen_notification_blocker.h"
......@@ -97,8 +98,12 @@ int AshMessagePopupCollection::GetToastOriginX(
int AshMessagePopupCollection::GetBaseline() const {
gfx::Insets tray_bubble_insets = GetTrayBubbleInsets();
int hotseat_height =
shelf_->hotseat_widget()->state() == HotseatState::kExtended
? shelf_->hotseat_widget()->GetHotseatSize()
: 0;
return work_area_.bottom() - tray_bubble_insets.bottom() -
tray_bubble_height_;
tray_bubble_height_ - hotseat_height;
}
gfx::Rect AshMessagePopupCollection::GetWorkArea() const {
......@@ -215,6 +220,11 @@ void AshMessagePopupCollection::OnShelfWorkAreaInsetsChanged() {
UpdateWorkArea();
}
void AshMessagePopupCollection::OnHotseatStateChanged(HotseatState old_state,
HotseatState new_state) {
ResetBounds();
}
///////////////////////////////////////////////////////////////////////////////
// display::DisplayObserver:
......
......@@ -90,6 +90,8 @@ class ASH_EXPORT AshMessagePopupCollection
// ShelfObserver:
void OnShelfWorkAreaInsetsChanged() override;
void OnHotseatStateChanged(HotseatState old_state,
HotseatState new_state) override;
// display::DisplayObserver:
void OnDisplayMetricsChanged(const display::Display& display,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment