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

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

Issue 2509783002: Don't reset scroll position of contents on every ScrollView layout. (Closed)
Patch Set: make test work with scrolling by layer (I think) --- i.e. fix mac 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"
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
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
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