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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 11 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) 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/macros.h" 10 #include "base/macros.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 const int button_height = button_bar_->GetPreferredSize().height(); 93 const int button_height = button_bar_->GetPreferredSize().height();
94 94
95 scroller_ = new views::ScrollView(); 95 scroller_ = new views::ScrollView();
96 scroller_->ClipHeightTo(kMinScrollViewHeight, max_height - button_height); 96 scroller_->ClipHeightTo(kMinScrollViewHeight, max_height - button_height);
97 scroller_->SetVerticalScrollBar(new views::OverlayScrollBar(false)); 97 scroller_->SetVerticalScrollBar(new views::OverlayScrollBar(false));
98 scroller_->SetHorizontalScrollBar(new views::OverlayScrollBar(true)); 98 scroller_->SetHorizontalScrollBar(new views::OverlayScrollBar(true));
99 scroller_->set_background( 99 scroller_->set_background(
100 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor)); 100 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor));
101 101
102 scroller_->SetPaintToLayer(true); 102 scroller_->SetPaintToLayer();
103 scroller_->layer()->SetFillsBoundsOpaquely(false); 103 scroller_->layer()->SetFillsBoundsOpaquely(false);
104 scroller_->layer()->SetMasksToBounds(true); 104 scroller_->layer()->SetMasksToBounds(true);
105 105
106 message_list_view_.reset(new MessageListView()); 106 message_list_view_.reset(new MessageListView());
107 message_list_view_->set_owned_by_client(); 107 message_list_view_->set_owned_by_client();
108 message_list_view_->AddObserver(this); 108 message_list_view_->AddObserver(this);
109 109
110 // We want to swap the contents of the scroll view between the empty list 110 // We want to swap the contents of the scroll view between the empty list
111 // view and the message list view, without constructing them afresh each 111 // view and the message list view, without constructing them afresh each
112 // time. So, since the scroll view deletes old contents each time you 112 // time. So, since the scroll view deletes old contents each time you
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 // Disable the close-all button since no notification is visible. 637 // Disable the close-all button since no notification is visible.
638 button_bar_->SetCloseAllButtonEnabled(false); 638 button_bar_->SetCloseAllButtonEnabled(false);
639 } 639 }
640 } 640 }
641 641
642 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 642 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
643 message_list_view_->AddNotificationAt(view, 0); 643 message_list_view_->AddNotificationAt(view, 0);
644 } 644 }
645 645
646 } // namespace message_center 646 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698