diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 17:20:46 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 17:20:46 +0000 |
commit | dd4b868b38fd7c3bd7af3b52cc6c0e4461597bdf (patch) | |
tree | b8ead8d38509b47564cb7733951d7ed583e38d55 /ash | |
parent | 6dd65399f63298f3a0412dddaff21db6be565361 (diff) | |
download | chromium_src-dd4b868b38fd7c3bd7af3b52cc6c0e4461597bdf.zip chromium_src-dd4b868b38fd7c3bd7af3b52cc6c0e4461597bdf.tar.gz chromium_src-dd4b868b38fd7c3bd7af3b52cc6c0e4461597bdf.tar.bz2 |
ash: Make sure the uber-tray popup is positioned correctly.
BUG=120698
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10027007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/system/tray/system_tray.cc | 15 | ||||
-rw-r--r-- | ash/wm/shelf_layout_manager.cc | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index ed64a7e..23a3df2 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -28,6 +28,7 @@ #include "ui/base/accessibility/accessible_view_state.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/screen.h" #include "ui/gfx/skia_util.h" #include "ui/views/border.h" #include "ui/views/bubble/bubble_delegate.h" @@ -351,6 +352,20 @@ class SystemTrayBubble : public views::BubbleDelegateView { } } + virtual gfx::Rect GetAnchorRect() OVERRIDE { + views::Widget* widget = tray_->GetWidget(); + if (widget->IsVisible()) { + gfx::Rect rect = widget->GetWindowScreenBounds(); + rect.Inset(0, 0, kPaddingFromRightEdgeOfScreen, + kPaddingFromBottomOfScreen); + return rect; + } + gfx::Rect rect = gfx::Screen::GetPrimaryMonitorBounds(); + return gfx::Rect(rect.width() - kPaddingFromRightEdgeOfScreen, + rect.height() - kPaddingFromBottomOfScreen, + 0, 0); + } + // Overridden from views::View. virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { state->role = ui::AccessibilityTypes::ROLE_WINDOW; diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc index f010bfc..2d3abad 100644 --- a/ash/wm/shelf_layout_manager.cc +++ b/ash/wm/shelf_layout_manager.cc @@ -129,9 +129,9 @@ void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { } bool ShelfLayoutManager::IsVisible() const { - return state_.visibility_state == VISIBLE || + return status_->IsVisible() && (state_.visibility_state == VISIBLE || (state_.visibility_state == AUTO_HIDE && - state_.auto_hide_state == AUTO_HIDE_SHOWN); + state_.auto_hide_state == AUTO_HIDE_SHOWN)); } gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( |