Commit 593f022c authored by Quan Nguyen's avatar Quan Nguyen Committed by Commit Bot

cros: Don't reposition login bubbles vertically.

Previously we prevented the login bubbles from overlapping into the shelf.
This had some annoying side effects like obscuring the password field. This
CL removes that part of the widget repositioning logic.

A future CL will address the potential case of login bubbles going off screen
on the bottom. Need to clarify the correct UX for this case.

Bug: 880224, 875787
Change-Id: Iea42cd612e9b0c57516fdc9681843182fa8d268b
Reviewed-on: https://chromium-review.googlesource.com/1217742Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590087}
parent eb7f6dd7
......@@ -499,7 +499,7 @@ void LoginBubble::OnWidgetDestroying(views::Widget* widget) {
void LoginBubble::OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& new_bounds) {
EnsureBubbleInWorkArea();
EnsureBubbleInScreen();
}
void LoginBubble::OnMouseEvent(ui::MouseEvent* event) {
......@@ -559,7 +559,7 @@ void LoginBubble::Show() {
DCHECK(bubble_view_);
views::Widget* widget =
views::BubbleDialogDelegateView::CreateBubble(bubble_view_);
EnsureBubbleInWorkArea();
EnsureBubbleInScreen();
widget->ShowInactive();
widget->AddObserver(this);
widget->StackAtTop();
......@@ -643,7 +643,7 @@ void LoginBubble::Reset(bool widget_already_closing) {
flags_ = kFlagsNone;
}
void LoginBubble::EnsureBubbleInWorkArea() {
void LoginBubble::EnsureBubbleInScreen() {
DCHECK(bubble_view_);
DCHECK(bubble_view_->GetWidget());
......@@ -654,14 +654,8 @@ void LoginBubble::EnsureBubbleInWorkArea() {
bubble_view_->GetWidget()->GetNativeWindow())
.work_area();
int vertical_offset = 0;
int horizontal_offset = 0;
// If the widget extends down into the shelf, move it up.
if (work_area.bottom() < view_bounds.bottom()) {
vertical_offset = work_area.bottom() - view_bounds.bottom();
}
// If the widget extends past the right side of the screen, make it go to
// the left instead.
if (work_area.right() < view_bounds.right()) {
......@@ -670,7 +664,7 @@ void LoginBubble::EnsureBubbleInWorkArea() {
bubble_view_->set_anchor_view_insets(
bubble_view_->anchor_view_insets().Offset(
gfx::Vector2d(horizontal_offset, vertical_offset)));
gfx::Vector2d(horizontal_offset, 0)));
bubble_view_->OnAnchorBoundsChanged();
}
......
......@@ -126,7 +126,7 @@ class ASH_EXPORT LoginBubble : public views::WidgetObserver,
void Reset(bool widget_already_closing);
// Repositions the bubble view if it extends too far right or down.
void EnsureBubbleInWorkArea();
void EnsureBubbleInScreen();
// Flags passed to ShowErrorBubble().
uint32_t flags_ = kFlagsNone;
......
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