| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/common/system/tray/fixed_sized_scroll_view.h" | 5 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ui/views/background.h" | |
| 9 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" | 8 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
| 10 | 9 |
| 11 namespace ash { | 10 namespace ash { |
| 12 | 11 |
| 13 namespace { | 12 namespace { |
| 14 | 13 |
| 15 bool UseMd() { | 14 bool UseMd() { |
| 16 return MaterialDesignController::IsSystemTrayMenuMaterial(); | 15 return MaterialDesignController::IsSystemTrayMenuMaterial(); |
| 17 } | 16 } |
| 18 | 17 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void FixedSizedScrollView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 79 void FixedSizedScrollView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 81 if (UseMd()) | 80 if (UseMd()) |
| 82 return; | 81 return; |
| 83 | 82 |
| 84 gfx::Rect bounds = gfx::Rect(contents()->GetPreferredSize()); | 83 gfx::Rect bounds = gfx::Rect(contents()->GetPreferredSize()); |
| 85 bounds.set_width(std::max(0, width() - GetScrollBarWidth())); | 84 bounds.set_width(std::max(0, width() - GetScrollBarWidth())); |
| 86 contents()->SetBoundsRect(bounds); | 85 contents()->SetBoundsRect(bounds); |
| 87 } | 86 } |
| 88 | 87 |
| 89 } // namespace ash | 88 } // namespace ash |
| OLD | NEW |