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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: Refactor 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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/compositor/layer_type.h"
16 #include "ui/gfx/animation/multi_animation.h" 17 #include "ui/gfx/animation/multi_animation.h"
17 #include "ui/gfx/canvas.h" 18 #include "ui/gfx/canvas.h"
18 #include "ui/gfx/geometry/insets.h" 19 #include "ui/gfx/geometry/insets.h"
19 #include "ui/gfx/geometry/rect.h" 20 #include "ui/gfx/geometry/rect.h"
20 #include "ui/gfx/geometry/size.h" 21 #include "ui/gfx/geometry/size.h"
21 #include "ui/message_center/message_center.h" 22 #include "ui/message_center/message_center.h"
22 #include "ui/message_center/message_center_style.h" 23 #include "ui/message_center/message_center_style.h"
23 #include "ui/message_center/message_center_tray.h" 24 #include "ui/message_center/message_center_tray.h"
24 #include "ui/message_center/message_center_types.h" 25 #include "ui/message_center/message_center_types.h"
25 #include "ui/message_center/views/message_center_button_bar.h" 26 #include "ui/message_center/views/message_center_button_bar.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 const int button_height = button_bar_->GetPreferredSize().height(); 94 const int button_height = button_bar_->GetPreferredSize().height();
94 95
95 scroller_ = new views::ScrollView(); 96 scroller_ = new views::ScrollView();
96 scroller_->ClipHeightTo(kMinScrollViewHeight, max_height - button_height); 97 scroller_->ClipHeightTo(kMinScrollViewHeight, max_height - button_height);
97 scroller_->SetVerticalScrollBar(new views::OverlayScrollBar(false)); 98 scroller_->SetVerticalScrollBar(new views::OverlayScrollBar(false));
98 scroller_->SetHorizontalScrollBar(new views::OverlayScrollBar(true)); 99 scroller_->SetHorizontalScrollBar(new views::OverlayScrollBar(true));
99 scroller_->set_background( 100 scroller_->set_background(
100 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor)); 101 views::Background::CreateSolidBackground(kMessageCenterBackgroundColor));
101 102
102 scroller_->SetPaintToLayer(true); 103 scroller_->SetPaintToLayer(ui::LAYER_TEXTURED);
103 scroller_->layer()->SetFillsBoundsOpaquely(false); 104 scroller_->layer()->SetFillsBoundsOpaquely(false);
104 scroller_->layer()->SetMasksToBounds(true); 105 scroller_->layer()->SetMasksToBounds(true);
105 106
106 message_list_view_.reset(new MessageListView()); 107 message_list_view_.reset(new MessageListView());
107 message_list_view_->set_owned_by_client(); 108 message_list_view_->set_owned_by_client();
108 message_list_view_->AddObserver(this); 109 message_list_view_->AddObserver(this);
109 110
110 // We want to swap the contents of the scroll view between the empty list 111 // 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 112 // view and the message list view, without constructing them afresh each
112 // time. So, since the scroll view deletes old contents each time you 113 // 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. 638 // Disable the close-all button since no notification is visible.
638 button_bar_->SetCloseAllButtonEnabled(false); 639 button_bar_->SetCloseAllButtonEnabled(false);
639 } 640 }
640 } 641 }
641 642
642 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 643 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
643 message_list_view_->AddNotificationAt(view, 0); 644 message_list_view_->AddNotificationAt(view, 0);
644 } 645 }
645 646
646 } // namespace message_center 647 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698