diff options
author | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 20:24:08 +0000 |
---|---|---|
committer | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 20:24:08 +0000 |
commit | 83dd11e38d14d0650f4f1ee5ebe5689f478141e5 (patch) | |
tree | d85f4f6abb5b927cedd71e96d4e1badf08b5e1aa /ui/message_center | |
parent | b7572ea5e89509184ff67c635f892bb44bc09918 (diff) | |
download | chromium_src-83dd11e38d14d0650f4f1ee5ebe5689f478141e5.zip chromium_src-83dd11e38d14d0650f4f1ee5ebe5689f478141e5.tar.gz chromium_src-83dd11e38d14d0650f4f1ee5ebe5689f478141e5.tar.bz2 |
Win8: Ensure correct desktop for various notification center widgets.
Currently all widgets in the regular views hierarchy are homed on the
"Active Desktop" which may be the Metro/Ash desktop. This creates
duplicate views of the notifications since we also have a separate
infrastructure for showing notifications in Ash.
BUG=322690,321605
Review URL: https://codereview.chromium.org/84083003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r-- | ui/message_center/message_center.gyp | 8 | ||||
-rw-r--r-- | ui/message_center/views/toast_contents_view.cc | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/ui/message_center/message_center.gyp b/ui/message_center/message_center.gyp index 42d0aef..431ef9e 100644 --- a/ui/message_center/message_center.gyp +++ b/ui/message_center/message_center.gyp @@ -98,6 +98,14 @@ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], 'conditions': [ + # This condition is for Windows 8 Metro mode support. We need to + # specify a particular desktop during widget creation in that case. + # This is done using the desktop aura native widget framework. + ['use_ash==1 and OS=="win"', { + 'dependencies': [ + '../aura/aura.gyp:aura', + ], + }], ['toolkit_views==1', { 'dependencies': [ '../events/events.gyp:events', diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc index 1ca3ed0..a1bc34f 100644 --- a/ui/message_center/views/toast_contents_view.cc +++ b/ui/message_center/views/toast_contents_view.cc @@ -24,6 +24,10 @@ #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" +#if defined(OS_WIN) && defined(USE_ASH) +#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" +#endif + namespace message_center { namespace { @@ -79,6 +83,15 @@ views::Widget* ToastContentsView::CreateWidget(gfx::NativeView parent) { params.delegate = this; views::Widget* widget = new views::Widget(); widget->set_focus_on_creation(false); + +#if defined(OS_WIN) && defined(USE_ASH) + // We want to ensure that this toast always goes to the native desktop, + // not the Ash desktop (since there is already another toast contents view + // there. + if (!params.parent) + params.native_widget = new views::DesktopNativeWidgetAura(widget); +#endif + widget->Init(params); return widget; } |