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

Unified Diff: ui/views/controls/scrollbar/base_scroll_bar.cc

Issue 171423003: Update local BaseScrollBar::contents_scroll_offset_ on Update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep disabled tests disabled. Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/scrollbar/native_scroll_bar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scrollbar/base_scroll_bar.cc
diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc
index 2e9d7f277562bfeab5132bbd39cb29e9e26b5922..99ec75a5510baa15918982b277ed4243e63e9ca2 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc
@@ -388,7 +388,8 @@ void BaseScrollBar::ExecuteCommand(int id) {
///////////////////////////////////////////////////////////////////////////////
// BaseScrollBar, ScrollBar implementation:
-void BaseScrollBar::Update(int viewport_size, int content_size,
+void BaseScrollBar::Update(int viewport_size,
+ int content_size,
int contents_scroll_offset) {
ScrollBar::Update(viewport_size, content_size, contents_scroll_offset);
@@ -404,6 +405,7 @@ void BaseScrollBar::Update(int viewport_size, int content_size,
contents_scroll_offset = 0;
if (contents_scroll_offset > content_size)
contents_scroll_offset = content_size;
+ contents_scroll_offset_ = contents_scroll_offset;
// Thumb Height and Thumb Pos.
// The height of the thumb is the ratio of the Viewport height to the
@@ -498,7 +500,7 @@ int BaseScrollBar::CalculateThumbPosition(int contents_scroll_offset) const {
}
int BaseScrollBar::CalculateContentsOffset(int thumb_position,
- bool scroll_to_middle) const {
+ bool scroll_to_middle) const {
if (scroll_to_middle)
thumb_position = thumb_position - (thumb_->GetSize() / 2);
return (thumb_position * contents_size_) / GetTrackSize();
« no previous file with comments | « no previous file | ui/views/controls/scrollbar/native_scroll_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698