Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / scroll / Scrollbar.cpp
index 2d8ccdf..96b5f79 100644 (file)
@@ -35,8 +35,6 @@
 #include "platform/scroll/ScrollableArea.h"
 #include "platform/scroll/ScrollbarTheme.h"
 
-using namespace std;
-
 #if ((OS(POSIX) && !OS(MACOSX)) || OS(WIN))
 // The position of the scrollbar thumb affects the appearance of the steppers, so
 // when the thumb moves, we have to invalidate them for painting.
@@ -100,12 +98,7 @@ void Scrollbar::removeFromParent()
 
 ScrollView* Scrollbar::parentScrollView() const
 {
-    return toScrollView(parent());
-}
-
-ScrollView* Scrollbar::rootScrollView() const
-{
-    return toScrollView(root());
+    return parent() && parent()->isScrollView() ? toScrollView(parent()) : 0;
 }
 
 ScrollbarOverlayStyle Scrollbar::scrollbarOverlayStyle() const
@@ -302,9 +295,9 @@ void Scrollbar::moveThumb(int pos, bool draggingDocument)
     int thumbLen = theme()->thumbLength(this);
     int trackLen = theme()->trackLength(this);
     if (delta > 0)
-        delta = min(trackLen - thumbLen - thumbPos, delta);
+        delta = std::min(trackLen - thumbLen - thumbPos, delta);
     else if (delta < 0)
-        delta = max(-thumbPos, delta);
+        delta = std::max(-thumbPos, delta);
 
     float minPos = m_scrollableArea->minimumScrollPosition(m_orientation);
     float maxPos = m_scrollableArea->maximumScrollPosition(m_orientation);