OLD | NEW |
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 bool top_down) | 173 bool top_down) |
174 : message_center_view_(message_center_view), | 174 : message_center_view_(message_center_view), |
175 reposition_top_(-1), | 175 reposition_top_(-1), |
176 fixed_height_(0), | 176 fixed_height_(0), |
177 has_deferred_task_(false), | 177 has_deferred_task_(false), |
178 clear_all_started_(false), | 178 clear_all_started_(false), |
179 top_down_(top_down), | 179 top_down_(top_down), |
180 weak_ptr_factory_(this) { | 180 weak_ptr_factory_(this) { |
181 views::BoxLayout* layout = | 181 views::BoxLayout* layout = |
182 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1); | 182 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1); |
183 layout->set_spread_blank_space(true); | 183 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_FILL); |
184 SetLayoutManager(layout); | 184 SetLayoutManager(layout); |
185 | 185 |
186 // Set the margin to 0 for the layout. BoxLayout assumes the same margin | 186 // Set the margin to 0 for the layout. BoxLayout assumes the same margin |
187 // for top and bottom, but the bottom margin here should be smaller | 187 // for top and bottom, but the bottom margin here should be smaller |
188 // because of the shadow of message view. Use an empty border instead | 188 // because of the shadow of message view. Use an empty border instead |
189 // to provide this margin. | 189 // to provide this margin. |
190 gfx::Insets shadow_insets = MessageView::GetShadowInsets(); | 190 gfx::Insets shadow_insets = MessageView::GetShadowInsets(); |
191 set_background(views::Background::CreateSolidBackground( | 191 set_background(views::Background::CreateSolidBackground( |
192 kMessageCenterBackgroundColor)); | 192 kMessageCenterBackgroundColor)); |
193 SetBorder(views::Border::CreateEmptyBorder( | 193 SetBorder(views::Border::CreateEmptyBorder( |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 scroller_->InvalidateLayout(); | 992 scroller_->InvalidateLayout(); |
993 PreferredSizeChanged(); | 993 PreferredSizeChanged(); |
994 Layout(); | 994 Layout(); |
995 } | 995 } |
996 | 996 |
997 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 997 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
998 message_list_view_->AddNotificationAt(view, 0); | 998 message_list_view_->AddNotificationAt(view, 0); |
999 } | 999 } |
1000 | 1000 |
1001 } // namespace message_center | 1001 } // namespace message_center |
OLD | NEW |