summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 18:26:44 +0000
committerskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 18:26:44 +0000
commitbec85dd5e7746b1ba5afeb4d6581006b18c8fe70 (patch)
tree1881e1482004299b1c6eb6b9465a6fec9c96f032 /ash
parent4f1ed672bc77c9aa499feee8ae9150b79c179188 (diff)
downloadchromium_src-bec85dd5e7746b1ba5afeb4d6581006b18c8fe70.zip
chromium_src-bec85dd5e7746b1ba5afeb4d6581006b18c8fe70.tar.gz
chromium_src-bec85dd5e7746b1ba5afeb4d6581006b18c8fe70.tar.bz2
Correct the jump list location for invocations while the launcher is animated into view.
I thought of adding an observer and a special way to the menu class to be able to get and change the view bounds dynamically - but this highly unlikely case does somehow not justify the complexity increase. BUG=236211 TEST=visual: razor sharp perception clicking required ;) Review URL: https://chromiumcodereview.appspot.com/17034003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/launcher/launcher_view.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index 7269b8c..0d1f898 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -38,6 +38,7 @@
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/point.h"
#include "ui/views/animation/bounds_animator.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
@@ -1570,6 +1571,14 @@ void LauncherView::ShowMenu(
ash::ShelfAlignment align = shelf->GetAlignment();
anchor_point = source->GetBoundsInScreen();
+ // It is possible to invoke the menu while it is sliding into view. To cover
+ // that case, the screen coordinates are offsetted by the animation delta.
+ gfx::Vector2d offset =
+ source->GetWidget()->GetNativeWindow()->bounds().origin() -
+ source->GetWidget()->GetNativeWindow()->GetTargetBounds().origin();
+ anchor_point.set_x(anchor_point.x() - offset.x());
+ anchor_point.set_y(anchor_point.y() - offset.y());
+
// Launcher items can have an asymmetrical border for spacing reasons.
// Adjust anchor location for this.
if (source->border())