| 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 "chrome/browser/ui/views/message_center/web_notification_tray.h" | 10 #include "chrome/browser/ui/views/message_center/web_notification_tray.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #if defined(USE_ASH) | 25 #if defined(USE_ASH) |
| 26 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 26 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace message_center { | 29 namespace message_center { |
| 30 | 30 |
| 31 MessageCenterWidgetDelegate::MessageCenterWidgetDelegate( | 31 MessageCenterWidgetDelegate::MessageCenterWidgetDelegate( |
| 32 WebNotificationTray* tray, | 32 WebNotificationTray* tray, |
| 33 MessageCenterTray* mc_tray, | 33 MessageCenterTray* mc_tray, |
| 34 bool initially_settings_visible, | 34 bool initially_settings_visible, |
| 35 const PositionInfo& pos_info) | 35 const PositionInfo& pos_info, |
| 36 const base::string16& title) |
| 36 : MessageCenterView(tray->message_center(), | 37 : MessageCenterView(tray->message_center(), |
| 37 mc_tray, | 38 mc_tray, |
| 38 pos_info.max_height, | 39 pos_info.max_height, |
| 39 initially_settings_visible, | 40 initially_settings_visible, |
| 40 pos_info.message_center_alignment & | 41 pos_info.message_center_alignment & |
| 41 ALIGNMENT_TOP), // Show buttons on top if message | 42 ALIGNMENT_TOP, // Show buttons on top if message |
| 42 // center is top aligned | 43 // center is top aligned |
| 44 title), |
| 43 pos_info_(pos_info), | 45 pos_info_(pos_info), |
| 44 tray_(tray) { | 46 tray_(tray) { |
| 45 // A WidgetDelegate should be deleted on DeleteDelegate. | 47 // A WidgetDelegate should be deleted on DeleteDelegate. |
| 46 set_owned_by_client(); | 48 set_owned_by_client(); |
| 47 | 49 |
| 48 views::BoxLayout* layout = | 50 views::BoxLayout* layout = |
| 49 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); | 51 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); |
| 50 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); | 52 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); |
| 51 SetLayoutManager(layout); | 53 SetLayoutManager(layout); |
| 52 | 54 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 bounds.set_y(corrected_anchor.y() - size.height()); | 237 bounds.set_y(corrected_anchor.y() - size.height()); |
| 236 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) | 238 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) |
| 237 bounds.set_x(corrected_anchor.x()); | 239 bounds.set_x(corrected_anchor.x()); |
| 238 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) | 240 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) |
| 239 bounds.set_x(corrected_anchor.x() - size.width()); | 241 bounds.set_x(corrected_anchor.x() - size.width()); |
| 240 | 242 |
| 241 return bounds; | 243 return bounds; |
| 242 } | 244 } |
| 243 | 245 |
| 244 } // namespace message_center | 246 } // namespace message_center |
| OLD | NEW |