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

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

Issue 2286843002: Rename DisplayItem::Type enum constants to Chromium style. (Closed)
Patch Set: Rebasing... Created 4 years, 3 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 result = ForwardButtonEndPart; 177 result = ForwardButtonEndPart;
178 } 178 }
179 return result; 179 return result;
180 } 180 }
181 181
182 void ScrollbarTheme::paintScrollCorner(GraphicsContext& context, const DisplayIt emClient& displayItemClient, const IntRect& cornerRect) 182 void ScrollbarTheme::paintScrollCorner(GraphicsContext& context, const DisplayIt emClient& displayItemClient, const IntRect& cornerRect)
183 { 183 {
184 if (cornerRect.isEmpty()) 184 if (cornerRect.isEmpty())
185 return; 185 return;
186 186
187 if (DrawingRecorder::useCachedDrawingIfPossible(context, displayItemClient, DisplayItem::ScrollbarCorner)) 187 if (DrawingRecorder::useCachedDrawingIfPossible(context, displayItemClient, DisplayItem::kScrollbarCorner))
188 return; 188 return;
189 189
190 DrawingRecorder recorder(context, displayItemClient, DisplayItem::ScrollbarC orner, cornerRect); 190 DrawingRecorder recorder(context, displayItemClient, DisplayItem::kScrollbar Corner, 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(evt.poi nterProperties().button, evt.shiftKey(), evt.altKey()); 200 return Platform::current()->scrollbarBehavior()->shouldCenterOnThumb(evt.poi nterProperties().button, evt.shiftKey(), evt.altKey());
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 bool ScrollbarTheme::mockScrollbarsEnabled() 319 bool ScrollbarTheme::mockScrollbarsEnabled()
320 { 320 {
321 return gMockScrollbarsEnabled; 321 return gMockScrollbarsEnabled;
322 } 322 }
323 323
324 DisplayItem::Type ScrollbarTheme::buttonPartToDisplayItemType(ScrollbarPart part ) 324 DisplayItem::Type ScrollbarTheme::buttonPartToDisplayItemType(ScrollbarPart part )
325 { 325 {
326 switch (part) { 326 switch (part) {
327 case BackButtonStartPart: 327 case BackButtonStartPart:
328 return DisplayItem::ScrollbarBackButtonStart; 328 return DisplayItem::kScrollbarBackButtonStart;
329 case BackButtonEndPart: 329 case BackButtonEndPart:
330 return DisplayItem::ScrollbarBackButtonEnd; 330 return DisplayItem::kScrollbarBackButtonEnd;
331 case ForwardButtonStartPart: 331 case ForwardButtonStartPart:
332 return DisplayItem::ScrollbarForwardButtonStart; 332 return DisplayItem::kScrollbarForwardButtonStart;
333 case ForwardButtonEndPart: 333 case ForwardButtonEndPart:
334 return DisplayItem::ScrollbarForwardButtonEnd; 334 return DisplayItem::kScrollbarForwardButtonEnd;
335 default: 335 default:
336 ASSERT_NOT_REACHED(); 336 ASSERT_NOT_REACHED();
337 return DisplayItem::ScrollbarBackButtonStart; 337 return DisplayItem::kScrollbarBackButtonStart;
338 } 338 }
339 } 339 }
340 340
341 DisplayItem::Type ScrollbarTheme::trackPiecePartToDisplayItemType(ScrollbarPart part) 341 DisplayItem::Type ScrollbarTheme::trackPiecePartToDisplayItemType(ScrollbarPart part)
342 { 342 {
343 switch (part) { 343 switch (part) {
344 case BackTrackPart: 344 case BackTrackPart:
345 return DisplayItem::ScrollbarBackTrack; 345 return DisplayItem::kScrollbarBackTrack;
346 case ForwardTrackPart: 346 case ForwardTrackPart:
347 return DisplayItem::ScrollbarForwardTrack; 347 return DisplayItem::kScrollbarForwardTrack;
348 default: 348 default:
349 ASSERT_NOT_REACHED(); 349 ASSERT_NOT_REACHED();
350 return DisplayItem::ScrollbarBackTrack; 350 return DisplayItem::kScrollbarBackTrack;
351 } 351 }
352 } 352 }
353 353
354 } // namespace blink 354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698