| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/system/tray/tray_details_view.h" | 5 #include "ash/system/tray/tray_details_view.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/fixed_sized_scroll_view.h" | 7 #include "ash/system/tray/fixed_sized_scroll_view.h" |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
| 10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void TrayDetailsView::CreateScrollableList() { | 89 void TrayDetailsView::CreateScrollableList() { |
| 90 DCHECK(!scroller_); | 90 DCHECK(!scroller_); |
| 91 scroll_content_ = new views::View; | 91 scroll_content_ = new views::View; |
| 92 scroll_content_->SetLayoutManager(new views::BoxLayout( | 92 scroll_content_->SetLayoutManager(new views::BoxLayout( |
| 93 views::BoxLayout::kVertical, 0, 0, 1)); | 93 views::BoxLayout::kVertical, 0, 0, 1)); |
| 94 scroller_ = new FixedSizedScrollView; | 94 scroller_ = new FixedSizedScrollView; |
| 95 scroller_->SetContentsView(scroll_content_); | 95 scroller_->SetContentsView(scroll_content_); |
| 96 | 96 |
| 97 // Note: |scroller_| takes ownership of |scroll_border_|. | 97 // Note: |scroller_| takes ownership of |scroll_border_|. |
| 98 scroll_border_ = new ScrollBorder; | 98 scroll_border_ = new ScrollBorder; |
| 99 scroller_->set_border(scroll_border_); | 99 scroller_->SetBorder(scoped_ptr<views::Border>(scroll_border_)); |
| 100 | 100 |
| 101 AddChildView(scroller_); | 101 AddChildView(scroller_); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void TrayDetailsView::AddScrollSeparator() { | 104 void TrayDetailsView::AddScrollSeparator() { |
| 105 DCHECK(scroll_content_); | 105 DCHECK(scroll_content_); |
| 106 // Do not draw the separator if it is the very first item | 106 // Do not draw the separator if it is the very first item |
| 107 // in the scrollable list. | 107 // in the scrollable list. |
| 108 if (scroll_content_->has_children()) | 108 if (scroll_content_->has_children()) |
| 109 scroll_content_->AddChildView(new ScrollSeparator); | 109 scroll_content_->AddChildView(new ScrollSeparator); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 scroll_border_->set_visible(true); | 156 scroll_border_->set_visible(true); |
| 157 else | 157 else |
| 158 scroll_border_->set_visible(false); | 158 scroll_border_->set_visible(false); |
| 159 } | 159 } |
| 160 | 160 |
| 161 views::View::OnPaintBorder(canvas); | 161 views::View::OnPaintBorder(canvas); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace internal | 164 } // namespace internal |
| 165 } // namespace ash | 165 } // namespace ash |
| OLD | NEW |