| 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_menu_button.h" | 10 #include "ash/common/system/tray/system_menu_button.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuArrowBackIcon, | 477 this, SystemMenuButton::InkDropStyle::SQUARE, kSystemMenuArrowBackIcon, |
| 478 IDS_ASH_STATUS_TRAY_PREVIOUS_MENU); | 478 IDS_ASH_STATUS_TRAY_PREVIOUS_MENU); |
| 479 return button; | 479 return button; |
| 480 } | 480 } |
| 481 | 481 |
| 482 void TrayDetailsView::Layout() { | 482 void TrayDetailsView::Layout() { |
| 483 if (UseMd()) { | 483 if (UseMd()) { |
| 484 views::View::Layout(); | 484 views::View::Layout(); |
| 485 if (scroller_ && !scroller_->is_bounded()) | 485 if (scroller_ && !scroller_->is_bounded()) |
| 486 scroller_->ClipHeightTo(0, scroller_->height()); | 486 scroller_->ClipHeightTo(0, scroller_->height()); |
| 487 return; |
| 487 } | 488 } |
| 488 | 489 |
| 489 if (UseMd() || bounds().IsEmpty()) { | 490 if (bounds().IsEmpty()) { |
| 490 views::View::Layout(); | 491 views::View::Layout(); |
| 491 return; | 492 return; |
| 492 } | 493 } |
| 493 | 494 |
| 494 if (scroller_) { | 495 if (scroller_) { |
| 495 scroller_->set_fixed_size(gfx::Size()); | 496 scroller_->set_fixed_size(gfx::Size()); |
| 496 gfx::Size size = GetPreferredSize(); | 497 gfx::Size size = GetPreferredSize(); |
| 497 | 498 |
| 498 // Set the scroller to fill the space above the bottom row, so that the | 499 // Set the scroller to fill the space above the bottom row, so that the |
| 499 // bottom row of the detailed view will always stay just above the title | 500 // bottom row of the detailed view will always stay just above the title |
| (...skipping 30 matching lines...) Expand all Loading... |
| 530 if (index < child_count() - 1 && child_at(index + 1) != title_row_) | 531 if (index < child_count() - 1 && child_at(index + 1) != title_row_) |
| 531 scroll_border_->set_visible(true); | 532 scroll_border_->set_visible(true); |
| 532 else | 533 else |
| 533 scroll_border_->set_visible(false); | 534 scroll_border_->set_visible(false); |
| 534 } | 535 } |
| 535 | 536 |
| 536 views::View::OnPaintBorder(canvas); | 537 views::View::OnPaintBorder(canvas); |
| 537 } | 538 } |
| 538 | 539 |
| 539 } // namespace ash | 540 } // namespace ash |
| OLD | NEW |