Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2636)

Unified Diff: ash/system/tray/system_tray.cc

Issue 10027007: ash: Make sure the uber-tray popup is positioned correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index ed64a7e2e9dc44f78a42a7656ffb13e71a722a74..23a3df2225f1f34788f127d89f2f300f558af915 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;
« no previous file with comments | « no previous file | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698