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

Unified Diff: ui/message_center/message_center_bubble.cc

Issue 12082064: makes NotificationView aware of border. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/message_center/notification_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/message_center_bubble.cc
diff --git a/ui/message_center/message_center_bubble.cc b/ui/message_center/message_center_bubble.cc
index f7f4af391a6be9e90037a706a966fa6f0ae011d6..72a4486474ed0e3dc66d0b0b5827275ff038cee0 100644
--- a/ui/message_center/message_center_bubble.cc
+++ b/ui/message_center/message_center_bubble.cc
@@ -369,32 +369,6 @@ class MessageViewShadowBorder : public views::Border {
}
};
-// A layout manager which is similar to views::FillLayout but respects the
-// border.
-class FillWithBorderLayout : public views::LayoutManager {
- public:
- FillWithBorderLayout() {}
- virtual ~FillWithBorderLayout() {}
-
- // views::LayoutManager overrides:
- virtual void Layout(views::View* host) OVERRIDE {
- if (!host->has_children())
- return;
- host->child_at(0)->SetBoundsRect(host->GetContentsBounds());
- }
-
- virtual gfx::Size GetPreferredSize(views::View* host) OVERRIDE {
- DCHECK_EQ(1, host->child_count());
- gfx::Size size = host->child_at(0)->GetPreferredSize();
- gfx::Insets insets = host->GetInsets();
- size.Enlarge(insets.width(), insets.height());
- return size;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(FillWithBorderLayout);
-};
-
} // namespace
// Message Center contents.
@@ -440,15 +414,9 @@ class MessageCenterContentsView : public views::View {
NotificationView::ViewForNotification(*iter, list_delegate_);
view->set_scroller(scroller_);
view->SetUpView();
- if (UseNewDesign()) {
- views::View* container = new views::View();
- container->SetLayoutManager(new FillWithBorderLayout());
- container->set_border(new MessageViewShadowBorder());
- container->AddChildView(view);
- scroll_content_->AddChildView(container);
- } else {
- scroll_content_->AddChildView(view);
- }
+ if (UseNewDesign())
+ view->set_border(new MessageViewShadowBorder());
+ scroll_content_->AddChildView(view);
if (++num_children >=
NotificationList::kMaxVisibleMessageCenterNotifications) {
break;
« no previous file with comments | « no previous file | ui/message_center/notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698