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

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

Issue 360213002: Add Flex to views::BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « athena/home/bottom_home_view.cc ('k') | ui/message_center/views/message_center_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « athena/home/bottom_home_view.cc ('k') | ui/message_center/views/message_center_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698