| 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/common/system/tray/tray_details_view.h" | 5 #include "ash/common/system/tray/tray_details_view.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_view_ids.h" | 7 #include "ash/common/ash_view_ids.h" |
| 8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 back_button_ = title_row_->AddBackButton(this); | 315 back_button_ = title_row_->AddBackButton(this); |
| 316 | 316 |
| 317 Layout(); | 317 Layout(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void TrayDetailsView::CreateScrollableList() { | 320 void TrayDetailsView::CreateScrollableList() { |
| 321 DCHECK(!scroller_); | 321 DCHECK(!scroller_); |
| 322 scroll_content_ = new ScrollContentsView(); | 322 scroll_content_ = new ScrollContentsView(); |
| 323 scroller_ = new FixedSizedScrollView; | 323 scroller_ = new FixedSizedScrollView; |
| 324 scroller_->SetContentsView(scroll_content_); | 324 scroller_->SetContentsView(scroll_content_); |
| 325 // Make the |scroller_| have a layer to clip |scroll_content_|'s children. |
| 326 // TODO(varkha): Make the sticky rows work with EnableViewPortLayer(). |
| 327 scroller_->SetPaintToLayer(true); |
| 328 scroller_->set_background( |
| 329 views::Background::CreateSolidBackground(kBackgroundColor)); |
| 330 scroller_->layer()->SetMasksToBounds(true); |
| 325 | 331 |
| 326 // Note: |scroller_| takes ownership of |scroll_border_|. | 332 // Note: |scroller_| takes ownership of |scroll_border_|. |
| 327 if (!UseMd()) { | 333 if (!UseMd()) { |
| 328 // In MD, the scroller is always the last thing, so this border is | 334 // In MD, the scroller is always the last thing, so this border is |
| 329 // unnecessary and reserves extra space we don't want. | 335 // unnecessary and reserves extra space we don't want. |
| 330 scroll_border_ = new ScrollBorder; | 336 scroll_border_ = new ScrollBorder; |
| 331 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_)); | 337 scroller_->SetBorder(std::unique_ptr<views::Border>(scroll_border_)); |
| 332 } | 338 } |
| 333 | 339 |
| 334 AddChildView(scroller_); | 340 AddChildView(scroller_); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 if (index < child_count() - 1 && child_at(index + 1) != title_row_) | 451 if (index < child_count() - 1 && child_at(index + 1) != title_row_) |
| 446 scroll_border_->set_visible(true); | 452 scroll_border_->set_visible(true); |
| 447 else | 453 else |
| 448 scroll_border_->set_visible(false); | 454 scroll_border_->set_visible(false); |
| 449 } | 455 } |
| 450 | 456 |
| 451 views::View::OnPaintBorder(canvas); | 457 views::View::OnPaintBorder(canvas); |
| 452 } | 458 } |
| 453 | 459 |
| 454 } // namespace ash | 460 } // namespace ash |
| OLD | NEW |