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

Side by Side Diff: ui/message_center/views/message_list_view.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Resolving comments Created 3 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_list_view.h" 5 #include "ui/message_center/views/message_list_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const views::View* child = child_at(i); 170 const views::View* child = child_at(i);
171 if (!IsValidChild(child)) 171 if (!IsValidChild(child))
172 continue; 172 continue;
173 height += child->GetHeightForWidth(width) + padding; 173 height += child->GetHeightForWidth(width) + padding;
174 padding = kMarginBetweenItems - MessageView::GetShadowInsets().bottom(); 174 padding = kMarginBetweenItems - MessageView::GetShadowInsets().bottom();
175 } 175 }
176 176
177 return height + GetInsets().height(); 177 return height + GetInsets().height();
178 } 178 }
179 179
180 void MessageListView::PaintChildren(const ui::PaintContext& context) { 180 void MessageListView::PaintChildren(const views::PaintInfo& paint_info) {
181 // Paint in the inversed order. Otherwise upper notification may be 181 // Paint in the inversed order. Otherwise upper notification may be
182 // hidden by the lower one. 182 // hidden by the lower one.
183 for (int i = child_count() - 1; i >= 0; --i) { 183 for (int i = child_count() - 1; i >= 0; --i) {
184 if (!child_at(i)->layer()) 184 if (!child_at(i)->layer())
185 child_at(i)->Paint(context); 185 child_at(i)->Paint(paint_info);
186 } 186 }
187 } 187 }
188 188
189 void MessageListView::ReorderChildLayers(ui::Layer* parent_layer) { 189 void MessageListView::ReorderChildLayers(ui::Layer* parent_layer) {
190 // Reorder children to stack the last child layer at the top. Otherwise 190 // Reorder children to stack the last child layer at the top. Otherwise
191 // upper notification may be hidden by the lower one. 191 // upper notification may be hidden by the lower one.
192 for (int i = 0; i < child_count(); ++i) { 192 for (int i = 0; i < child_count(); ++i) {
193 if (child_at(i)->layer()) 193 if (child_at(i)->layer())
194 parent_layer->StackAtBottom(child_at(i)->layer()); 194 parent_layer->StackAtBottom(child_at(i)->layer());
195 } 195 }
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 base::TimeDelta::FromMilliseconds( 584 base::TimeDelta::FromMilliseconds(
585 kAnimateClearingNextNotificationDelayMS)); 585 kAnimateClearingNextNotificationDelayMS));
586 } 586 }
587 } 587 }
588 588
589 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) { 589 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) {
590 SetRepositionTarget(target_rect); 590 SetRepositionTarget(target_rect);
591 } 591 }
592 592
593 } // namespace message_center 593 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698