OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/message_center/message_center_widget_delegate.
h" | 5 #include "chrome/browser/ui/views/message_center/message_center_widget_delegate.
h" |
6 | 6 |
7 #include <complex> | 7 #include <complex> |
8 | 8 |
9 #include "chrome/browser/ui/views/message_center/message_center_frame_view.h" | 9 #include "chrome/browser/ui/views/message_center/message_center_frame_view.h" |
10 #include "content/public/browser/user_metrics.h" | 10 #include "content/public/browser/user_metrics.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 #if defined(USE_ASH) | 142 #if defined(USE_ASH) |
143 // This class is not used in Ash; there is another container for the message | 143 // This class is not used in Ash; there is another container for the message |
144 // center that's used there. So, we must be in a Views + Ash environment. We | 144 // center that's used there. So, we must be in a Views + Ash environment. We |
145 // want the notification center to be available on both desktops. Setting the | 145 // want the notification center to be available on both desktops. Setting the |
146 // |native_widget| variable here ensures that the widget is hosted on the | 146 // |native_widget| variable here ensures that the widget is hosted on the |
147 // native desktop. | 147 // native desktop. |
148 params.native_widget = new views::DesktopNativeWidgetAura(widget); | 148 params.native_widget = new views::DesktopNativeWidgetAura(widget); |
149 #endif | 149 #endif |
150 widget->Init(params); | 150 widget->Init(params); |
151 | 151 |
152 #if defined(OS_WIN) | |
153 // Remove the Message Center from taskbar and alt-tab rotation. | |
154 HWND hwnd = views::HWNDForWidget(widget); | |
155 LONG_PTR ex_styles = ::GetWindowLongPtr(hwnd, GWL_EXSTYLE); | |
156 ex_styles |= WS_EX_TOOLWINDOW; | |
157 ::SetWindowLongPtr(hwnd, GWL_EXSTYLE, ex_styles); | |
158 #endif | |
159 | |
160 widget->AddObserver(this); | 152 widget->AddObserver(this); |
161 widget->StackAtTop(); | 153 widget->StackAtTop(); |
162 widget->SetAlwaysOnTop(true); | 154 widget->SetAlwaysOnTop(true); |
163 | 155 |
164 const NotificationList::Notifications& notifications = | 156 const NotificationList::Notifications& notifications = |
165 tray_->message_center()->GetVisibleNotifications(); | 157 tray_->message_center()->GetVisibleNotifications(); |
166 SetNotifications(notifications); | 158 SetNotifications(notifications); |
167 | 159 |
168 widget->SetBounds(GetMessageCenterBounds()); | 160 widget->SetBounds(GetMessageCenterBounds()); |
169 widget->Show(); | 161 widget->Show(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 bounds.set_y(corrected_anchor.y() - size.height()); | 231 bounds.set_y(corrected_anchor.y() - size.height()); |
240 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) | 232 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) |
241 bounds.set_x(corrected_anchor.x()); | 233 bounds.set_x(corrected_anchor.x()); |
242 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) | 234 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) |
243 bounds.set_x(corrected_anchor.x() - size.width()); | 235 bounds.set_x(corrected_anchor.x() - size.width()); |
244 | 236 |
245 return bounds; | 237 return bounds; |
246 } | 238 } |
247 | 239 |
248 } // namespace message_center | 240 } // namespace message_center |
OLD | NEW |