summaryrefslogtreecommitdiffstats
path: root/ash/system/tray
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 17:29:43 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 17:29:43 +0000
commit596c61c153d7b113fee76160c20f4865b834b0ac (patch)
tree36b0bcbe5e38a922c63ff16d3261a9949b95f19f /ash/system/tray
parentf3fde867a6ad1210f1ad3ded55d82810b9db065a (diff)
downloadchromium_src-596c61c153d7b113fee76160c20f4865b834b0ac.zip
chromium_src-596c61c153d7b113fee76160c20f4865b834b0ac.tar.gz
chromium_src-596c61c153d7b113fee76160c20f4865b834b0ac.tar.bz2
Make sure tray widget doesn't move to other root windows.
There were two reasons why this was failing - Test was using too small display (width=100), which makes the tray widget's origin outside of the root. - GetDisplayNearestWindow was modified to use GetDisplayAt when we disabled extended desktop for 23. This fixes to use GetPrimaryDisplay() I also added kStayInSameRootWindowKey to make sure it will never leave the same root window. BUG=none TEST=ExtendedDesktopTest.OpenSystemTray pass without null check. Review URL: https://chromiumcodereview.appspot.com/11338002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/tray')
-rw-r--r--ash/system/tray/tray_bubble_view.cc6
-rw-r--r--ash/system/tray/tray_bubble_wrapper.cc3
2 files changed, 4 insertions, 5 deletions
diff --git a/ash/system/tray/tray_bubble_view.cc b/ash/system/tray/tray_bubble_view.cc
index 2d56dba..0578935 100644
--- a/ash/system/tray/tray_bubble_view.cc
+++ b/ash/system/tray/tray_bubble_view.cc
@@ -308,13 +308,9 @@ void TrayBubbleView::UpdateBubble() {
SizeToContents();
GetWidget()->GetRootView()->SchedulePaint();
aura::RootWindow* root_window = GetWidget()->GetNativeView()->GetRootWindow();
- // TODO(oshima): this NULL check shouldn't be needed.
- // ExtendedDesktopTest.OpenSystemTray currently triggers it. It indicates the
- // bubble is ending up on a display that doesn't have a shelf.
ash::internal::ShelfLayoutManager* shelf =
ash::GetRootWindowController(root_window)->shelf();
- const bool is_launcher_visible = shelf && shelf->IsVisible();
- bubble_border_->set_paint_arrow(is_launcher_visible);
+ bubble_border_->set_paint_arrow(shelf->IsVisible());
}
void TrayBubbleView::SetMaxHeight(int height) {
diff --git a/ash/system/tray/tray_bubble_wrapper.cc b/ash/system/tray/tray_bubble_wrapper.cc
index d591f25..5e92a84 100644
--- a/ash/system/tray/tray_bubble_wrapper.cc
+++ b/ash/system/tray/tray_bubble_wrapper.cc
@@ -7,6 +7,7 @@
#include "ash/system/tray/tray_background_view.h"
#include "ash/system/tray/tray_bubble_view.h"
#include "ash/system/tray/tray_event_filter.h"
+#include "ash/wm/window_properties.h"
#include "ui/views/widget/widget.h"
using message_center::TrayBubbleView;
@@ -20,6 +21,8 @@ TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray,
bubble_view_(bubble_view) {
bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_);
bubble_widget_->AddObserver(this);
+ bubble_widget_->GetNativeView()->
+ SetProperty(internal::kStayInSameRootWindowKey, true);
bubble_view_->InitializeAndShowBubble();
tray_->InitializeBubbleAnimations(bubble_widget_);