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

Unified Diff: ui/message_center/views/message_popup_collection.cc

Issue 12667018: Switch Windows to use the MessagePopupCollection (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 9 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 | « ui/message_center/message_center.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_popup_collection.cc
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc
index b9c9cc6679451f819abe75a253ffdb7635629cd2..ba9fb902bfb9bf3a673e77f2a886709af0d8f6e5 100644
--- a/ui/message_center/views/message_popup_collection.cc
+++ b/ui/message_center/views/message_popup_collection.cc
@@ -47,7 +47,10 @@ class ToastContentsView : public views::WidgetDelegateView {
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
params.keep_on_top = true;
- params.context = context;
+ if (context)
+ params.context = context;
+ else
+ params.top_level = true;
params.transparent = true;
// The origin of the initial bounds are set to (0, 0). It'll then moved by
// MessagePopupCollection.
@@ -147,8 +150,17 @@ void MessagePopupCollection::UpdatePopups() {
return;
}
- gfx::Screen* screen = gfx::Screen::GetScreenFor(context_);
- gfx::Rect work_area = screen->GetDisplayNearestWindow(context_).work_area();
+ gfx::Rect work_area;
+ if (!context_) {
+ // On Win+Aura, we don't have a context since the popups currently show up
+ // on the Windows desktop, not in the Aura/Ash desktop. This code will
+ // display the popups on the primary display.
+ gfx::Screen* screen = gfx::Screen::GetNativeScreen();
+ work_area = screen->GetPrimaryDisplay().work_area();
+ } else {
+ gfx::Screen* screen = gfx::Screen::GetScreenFor(context_);
+ work_area = screen->GetDisplayNearestWindow(context_).work_area();
+ }
std::set<std::string> old_toast_ids;
for (ToastContainer::iterator iter = toasts_.begin(); iter != toasts_.end();
« no previous file with comments | « ui/message_center/message_center.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698