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