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

Side by Side Diff: ui/message_center/views/message_center_view.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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/message_center/views/message_center_view.h" 5 #include "ui/message_center/views/message_center_view.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 bool top_down) 174 bool top_down)
175 : message_center_view_(message_center_view), 175 : message_center_view_(message_center_view),
176 reposition_top_(-1), 176 reposition_top_(-1),
177 fixed_height_(0), 177 fixed_height_(0),
178 has_deferred_task_(false), 178 has_deferred_task_(false),
179 clear_all_started_(false), 179 clear_all_started_(false),
180 top_down_(top_down), 180 top_down_(top_down),
181 weak_ptr_factory_(this) { 181 weak_ptr_factory_(this) {
182 views::BoxLayout* layout = 182 views::BoxLayout* layout =
183 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1); 183 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1);
184 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); 184 layout->SetDefaultFlex(1);
185 SetLayoutManager(layout); 185 SetLayoutManager(layout);
186 186
187 // Set the margin to 0 for the layout. BoxLayout assumes the same margin 187 // Set the margin to 0 for the layout. BoxLayout assumes the same margin
188 // for top and bottom, but the bottom margin here should be smaller 188 // for top and bottom, but the bottom margin here should be smaller
189 // because of the shadow of message view. Use an empty border instead 189 // because of the shadow of message view. Use an empty border instead
190 // to provide this margin. 190 // to provide this margin.
191 gfx::Insets shadow_insets = MessageView::GetShadowInsets(); 191 gfx::Insets shadow_insets = MessageView::GetShadowInsets();
192 set_background(views::Background::CreateSolidBackground( 192 set_background(views::Background::CreateSolidBackground(
193 kMessageCenterBackgroundColor)); 193 kMessageCenterBackgroundColor));
194 SetBorder(views::Border::CreateEmptyBorder( 194 SetBorder(views::Border::CreateEmptyBorder(
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 scroller_->InvalidateLayout(); 998 scroller_->InvalidateLayout();
999 PreferredSizeChanged(); 999 PreferredSizeChanged();
1000 Layout(); 1000 Layout();
1001 } 1001 }
1002 1002
1003 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 1003 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
1004 message_list_view_->AddNotificationAt(view, 0); 1004 message_list_view_->AddNotificationAt(view, 0);
1005 } 1005 }
1006 1006
1007 } // namespace message_center 1007 } // namespace message_center
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/message_center/message_center_widget_delegate.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698