Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Side by Side Diff: ash/common/system/tray/fixed_sized_scroll_view.cc

Issue 2509243002: Revert of Don't reset scroll position of contents on every ScrollView layout. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/bluetooth/tray_bluetooth.cc ('k') | ash/common/system/tray/tray_details_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698