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

Side by Side Diff: chrome/browser/ui/views/message_center/message_center_widget_delegate.cc

Issue 284753002: Add main axis alignment for BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove set_spread_blank_space, rename to MainAxisAlignment Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 29 matching lines...) Expand all
40 pos_info.message_center_alignment & 40 pos_info.message_center_alignment &
41 ALIGNMENT_TOP), // Show buttons on top if message 41 ALIGNMENT_TOP), // Show buttons on top if message
42 // center is top aligned 42 // center is top aligned
43 pos_info_(pos_info), 43 pos_info_(pos_info),
44 tray_(tray) { 44 tray_(tray) {
45 // A WidgetDelegate should be deleted on DeleteDelegate. 45 // A WidgetDelegate should be deleted on DeleteDelegate.
46 set_owned_by_client(); 46 set_owned_by_client();
47 47
48 views::BoxLayout* layout = 48 views::BoxLayout* layout =
49 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0); 49 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
50 layout->set_spread_blank_space(true); 50 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL);
51 SetLayoutManager(layout); 51 SetLayoutManager(layout);
52 52
53 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); 53 AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
54 54
55 SetPaintToLayer(true); 55 SetPaintToLayer(true);
56 SetFillsBoundsOpaquely(true); 56 SetFillsBoundsOpaquely(true);
57 57
58 InitWidget(); 58 InitWidget();
59 } 59 }
60 60
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 bounds.set_y(corrected_anchor.y() - size.height()); 235 bounds.set_y(corrected_anchor.y() - size.height());
236 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT) 236 if (pos_info_.message_center_alignment & ALIGNMENT_LEFT)
237 bounds.set_x(corrected_anchor.x()); 237 bounds.set_x(corrected_anchor.x());
238 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT) 238 if (pos_info_.message_center_alignment & ALIGNMENT_RIGHT)
239 bounds.set_x(corrected_anchor.x() - size.width()); 239 bounds.set_x(corrected_anchor.x() - size.width());
240 240
241 return bounds; 241 return bounds;
242 } 242 }
243 243
244 } // namespace message_center 244 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698