| OLD | NEW |
| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 return true; | 153 return true; |
| 154 } | 154 } |
| 155 | 155 |
| 156 ScrollbarPart ScrollbarTheme::HitTest(const ScrollbarThemeClient& scrollbar, | 156 ScrollbarPart ScrollbarTheme::HitTest(const ScrollbarThemeClient& scrollbar, |
| 157 const IntPoint& position_in_root_frame) { | 157 const IntPoint& position_in_root_frame) { |
| 158 ScrollbarPart result = kNoPart; | 158 ScrollbarPart result = kNoPart; |
| 159 if (!scrollbar.Enabled()) | 159 if (!scrollbar.Enabled()) |
| 160 return result; | 160 return result; |
| 161 | 161 |
| 162 IntPoint test_position = | 162 IntPoint test_position = |
| 163 scrollbar.ConvertFromRootFrame(position_in_root_frame); | 163 scrollbar.ConvertPointFromRootFrame(position_in_root_frame); |
| 164 test_position.Move(scrollbar.X(), scrollbar.Y()); | 164 test_position.Move(scrollbar.X(), scrollbar.Y()); |
| 165 | 165 |
| 166 if (!scrollbar.FrameRect().Contains(test_position)) | 166 if (!scrollbar.FrameRect().Contains(test_position)) |
| 167 return kNoPart; | 167 return kNoPart; |
| 168 | 168 |
| 169 result = kScrollbarBGPart; | 169 result = kScrollbarBGPart; |
| 170 | 170 |
| 171 IntRect track = TrackRect(scrollbar); | 171 IntRect track = TrackRect(scrollbar); |
| 172 if (track.Contains(test_position)) { | 172 if (track.Contains(test_position)) { |
| 173 IntRect before_thumb_rect; | 173 IntRect before_thumb_rect; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 FloatRect tick_stroke(rect.X() + TickmarkBorderWidth(), y_pos + 1, | 268 FloatRect tick_stroke(rect.X() + TickmarkBorderWidth(), y_pos + 1, |
| 269 rect.Width() - 2 * TickmarkBorderWidth(), 1); | 269 rect.Width() - 2 * TickmarkBorderWidth(), 1); |
| 270 context.FillRect(tick_stroke, Color(0xFF, 0xDD, 0x00, 0xFF)); | 270 context.FillRect(tick_stroke, Color(0xFF, 0xDD, 0x00, 0xFF)); |
| 271 } | 271 } |
| 272 #endif | 272 #endif |
| 273 } | 273 } |
| 274 | 274 |
| 275 bool ScrollbarTheme::ShouldSnapBackToDragOrigin( | 275 bool ScrollbarTheme::ShouldSnapBackToDragOrigin( |
| 276 const ScrollbarThemeClient& scrollbar, | 276 const ScrollbarThemeClient& scrollbar, |
| 277 const WebMouseEvent& evt) { | 277 const WebMouseEvent& evt) { |
| 278 IntPoint mouse_position = scrollbar.ConvertFromRootFrame( | 278 IntPoint mouse_position = scrollbar.ConvertPointFromRootFrame( |
| 279 FlooredIntPoint(evt.PositionInRootFrame())); | 279 FlooredIntPoint(evt.PositionInRootFrame())); |
| 280 mouse_position.Move(scrollbar.X(), scrollbar.Y()); | 280 mouse_position.Move(scrollbar.X(), scrollbar.Y()); |
| 281 return Platform::Current()->ScrollbarBehavior()->ShouldSnapBackToDragOrigin( | 281 return Platform::Current()->ScrollbarBehavior()->ShouldSnapBackToDragOrigin( |
| 282 mouse_position, TrackRect(scrollbar), | 282 mouse_position, TrackRect(scrollbar), |
| 283 scrollbar.Orientation() == kHorizontalScrollbar); | 283 scrollbar.Orientation() == kHorizontalScrollbar); |
| 284 } | 284 } |
| 285 | 285 |
| 286 double ScrollbarTheme::OverlayScrollbarFadeOutDelaySeconds() const { | 286 double ScrollbarTheme::OverlayScrollbarFadeOutDelaySeconds() const { |
| 287 // On Mac, fading is controlled by the painting code in ScrollAnimatorMac. | 287 // On Mac, fading is controlled by the painting code in ScrollAnimatorMac. |
| 288 return 0.0; | 288 return 0.0; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 return DisplayItem::kScrollbarBackTrack; | 438 return DisplayItem::kScrollbarBackTrack; |
| 439 case kForwardTrackPart: | 439 case kForwardTrackPart: |
| 440 return DisplayItem::kScrollbarForwardTrack; | 440 return DisplayItem::kScrollbarForwardTrack; |
| 441 default: | 441 default: |
| 442 ASSERT_NOT_REACHED(); | 442 ASSERT_NOT_REACHED(); |
| 443 return DisplayItem::kScrollbarBackTrack; | 443 return DisplayItem::kScrollbarBackTrack; |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 | 446 |
| 447 } // namespace blink | 447 } // namespace blink |
| OLD | NEW |