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

Side by Side Diff: Source/web/ScrollbarGroup.cpp

Issue 398673003: Rename WebCore namespace to blink in bindings and web (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/ScrollbarGroup.h ('k') | Source/web/ServiceWorkerGlobalScopeClientImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 14 matching lines...) Expand all
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "web/ScrollbarGroup.h" 27 #include "web/ScrollbarGroup.h"
28 28
29 #include "core/frame/FrameView.h" 29 #include "core/frame/FrameView.h"
30 #include "platform/scroll/Scrollbar.h" 30 #include "platform/scroll/Scrollbar.h"
31 #include "platform/scroll/ScrollbarTheme.h" 31 #include "platform/scroll/ScrollbarTheme.h"
32 #include "public/platform/WebRect.h" 32 #include "public/platform/WebRect.h"
33 #include "web/WebPluginScrollbarImpl.h" 33 #include "web/WebPluginScrollbarImpl.h"
34 34
35 using namespace WebCore; 35 using namespace blink;
36 36
37 namespace blink { 37 namespace blink {
38 38
39 ScrollbarGroup::ScrollbarGroup(FrameView* frameView, const IntRect& frameRect) 39 ScrollbarGroup::ScrollbarGroup(FrameView* frameView, const IntRect& frameRect)
40 : m_frameView(frameView) 40 : m_frameView(frameView)
41 , m_frameRect(frameRect) 41 , m_frameRect(frameRect)
42 , m_horizontalScrollbar(0) 42 , m_horizontalScrollbar(0)
43 , m_verticalScrollbar(0) 43 , m_verticalScrollbar(0)
44 { 44 {
45 } 45 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 m_frameView->removeScrollableArea(this); 84 m_frameView->removeScrollableArea(this);
85 m_frameView->setNeedsLayout(); 85 m_frameView->setNeedsLayout();
86 } 86 }
87 } 87 }
88 88
89 void ScrollbarGroup::setLastMousePosition(const IntPoint& point) 89 void ScrollbarGroup::setLastMousePosition(const IntPoint& point)
90 { 90 {
91 m_lastMousePosition = point; 91 m_lastMousePosition = point;
92 } 92 }
93 93
94 int ScrollbarGroup::scrollSize(WebCore::ScrollbarOrientation orientation) const 94 int ScrollbarGroup::scrollSize(blink::ScrollbarOrientation orientation) const
95 { 95 {
96 WebPluginScrollbarImpl* webScrollbar = orientation == HorizontalScrollbar ? m_horizontalScrollbar : m_verticalScrollbar; 96 WebPluginScrollbarImpl* webScrollbar = orientation == HorizontalScrollbar ? m_horizontalScrollbar : m_verticalScrollbar;
97 if (!webScrollbar) 97 if (!webScrollbar)
98 return 0; 98 return 0;
99 Scrollbar* scrollbar = webScrollbar->scrollbar(); 99 Scrollbar* scrollbar = webScrollbar->scrollbar();
100 return scrollbar->totalSize() - scrollbar->visibleSize(); 100 return scrollbar->totalSize() - scrollbar->visibleSize();
101 } 101 }
102 102
103 void ScrollbarGroup::setScrollOffset(const IntPoint& offset) 103 void ScrollbarGroup::setScrollOffset(const IntPoint& offset)
104 { 104 {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 278
279 int pageStep = std::max( 279 int pageStep = std::max(
280 static_cast<int>(static_cast<float>(length) * ScrollableArea::minFractio nToStepWhenPaging()), 280 static_cast<int>(static_cast<float>(length) * ScrollableArea::minFractio nToStepWhenPaging()),
281 length - ScrollableArea::maxOverlapBetweenPages()); 281 length - ScrollableArea::maxOverlapBetweenPages());
282 282
283 return std::max(pageStep, 1); 283 return std::max(pageStep, 1);
284 } 284 }
285 285
286 } // namespace blink 286 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ScrollbarGroup.h ('k') | Source/web/ServiceWorkerGlobalScopeClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698