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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp

Issue 2227563003: Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new instances Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2011 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 DrawingRecorder recorder(context, displayItemClient, DisplayItem::ScrollbarC orner, cornerRect); 190 DrawingRecorder recorder(context, displayItemClient, DisplayItem::ScrollbarC orner, cornerRect);
191 #if OS(MACOSX) 191 #if OS(MACOSX)
192 context.fillRect(cornerRect, Color::white); 192 context.fillRect(cornerRect, Color::white);
193 #else 193 #else
194 Platform::current()->themeEngine()->paint(context.canvas(), WebThemeEngine:: PartScrollbarCorner, WebThemeEngine::StateNormal, WebRect(cornerRect), 0); 194 Platform::current()->themeEngine()->paint(context.canvas(), WebThemeEngine:: PartScrollbarCorner, WebThemeEngine::StateNormal, WebRect(cornerRect), 0);
195 #endif 195 #endif
196 } 196 }
197 197
198 bool ScrollbarTheme::shouldCenterOnThumb(const ScrollbarThemeClient& scrollbar, const PlatformMouseEvent& evt) 198 bool ScrollbarTheme::shouldCenterOnThumb(const ScrollbarThemeClient& scrollbar, const PlatformMouseEvent& evt)
199 { 199 {
200 return Platform::current()->scrollbarBehavior()->shouldCenterOnThumb(static_ cast<WebScrollbarBehavior::Button>(evt.button()), evt.shiftKey(), evt.altKey()); 200 return Platform::current()->scrollbarBehavior()->shouldCenterOnThumb(evt.poi nterProperties().button, evt.shiftKey(), evt.altKey());
201 } 201 }
202 202
203 bool ScrollbarTheme::shouldSnapBackToDragOrigin(const ScrollbarThemeClient& scro llbar, const PlatformMouseEvent& evt) 203 bool ScrollbarTheme::shouldSnapBackToDragOrigin(const ScrollbarThemeClient& scro llbar, const PlatformMouseEvent& evt)
204 { 204 {
205 IntPoint mousePosition = scrollbar.convertFromRootFrame(evt.position()); 205 IntPoint mousePosition = scrollbar.convertFromRootFrame(evt.position());
206 mousePosition.move(scrollbar.x(), scrollbar.y()); 206 mousePosition.move(scrollbar.x(), scrollbar.y());
207 return Platform::current()->scrollbarBehavior()->shouldSnapBackToDragOrigin( mousePosition, trackRect(scrollbar), scrollbar.orientation() == HorizontalScroll bar); 207 return Platform::current()->scrollbarBehavior()->shouldSnapBackToDragOrigin( mousePosition, trackRect(scrollbar), scrollbar.orientation() == HorizontalScroll bar);
208 } 208 }
209 209
210 int ScrollbarTheme::thumbPosition(const ScrollbarThemeClient& scrollbar, float s crollPosition) 210 int ScrollbarTheme::thumbPosition(const ScrollbarThemeClient& scrollbar, float s crollPosition)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 return DisplayItem::ScrollbarBackTrack; 341 return DisplayItem::ScrollbarBackTrack;
342 case ForwardTrackPart: 342 case ForwardTrackPart:
343 return DisplayItem::ScrollbarForwardTrack; 343 return DisplayItem::ScrollbarForwardTrack;
344 default: 344 default:
345 ASSERT_NOT_REACHED(); 345 ASSERT_NOT_REACHED();
346 return DisplayItem::ScrollbarBackTrack; 346 return DisplayItem::ScrollbarBackTrack;
347 } 347 }
348 } 348 }
349 349
350 } // namespace blink 350 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.cpp ('k') | third_party/WebKit/Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698