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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 ALIGNMENT_TOP, // Show buttons on top if message | 42 ALIGNMENT_TOP, // Show buttons on top if message |
43 // center is top aligned | 43 // center is top aligned |
44 title), | 44 title), |
45 pos_info_(pos_info), | 45 pos_info_(pos_info), |
46 tray_(tray) { | 46 tray_(tray) { |
47 // A WidgetDelegate should be deleted on DeleteDelegate. | 47 // A WidgetDelegate should be deleted on DeleteDelegate. |
48 set_owned_by_client(); | 48 set_owned_by_client(); |
49 | 49 |
50 views::BoxLayout* layout = | 50 views::BoxLayout* layout = |
51 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); | 51 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); |
52 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); | 52 layout->SetDefaultFlex(1); |
53 SetLayoutManager(layout); | 53 SetLayoutManager(layout); |
54 | 54 |
55 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); | 55 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); |
56 | 56 |
57 SetPaintToLayer(true); | 57 SetPaintToLayer(true); |
58 SetFillsBoundsOpaquely(true); | 58 SetFillsBoundsOpaquely(true); |
59 | 59 |
60 InitWidget(); | 60 InitWidget(); |
61 } | 61 } |
62 | 62 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 bounds.set_y(corrected_anchor.y() - size.height()); | 236 bounds.set_y(corrected_anchor.y() - size.height()); |
237 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) | 237 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) |
238 bounds.set_x(corrected_anchor.x()); | 238 bounds.set_x(corrected_anchor.x()); |
239 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) | 239 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) |
240 bounds.set_x(corrected_anchor.x() - size.width()); | 240 bounds.set_x(corrected_anchor.x() - size.width()); |
241 | 241 |
242 return bounds; | 242 return bounds; |
243 } | 243 } |
244 | 244 |
245 } // namespace message_center | 245 } // namespace message_center |
OLD | NEW |