| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 // page cache, and | 1024 // page cache, and |
| 1025 // a relayout will happen on its own. Otherwise, we must initiate a re-layout | 1025 // a relayout will happen on its own. Otherwise, we must initiate a re-layout |
| 1026 // ourselves. | 1026 // ourselves. |
| 1027 if (!needs_scroller_style_update_) | 1027 if (!needs_scroller_style_update_) |
| 1028 GetScrollableArea()->ScrollbarStyleChanged(); | 1028 GetScrollableArea()->ScrollbarStyleChanged(); |
| 1029 | 1029 |
| 1030 needs_scroller_style_update_ = false; | 1030 needs_scroller_style_update_ = false; |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 void ScrollAnimatorMac::StartScrollbarPaintTimer() { | 1033 void ScrollAnimatorMac::StartScrollbarPaintTimer() { |
| 1034 initial_scrollbar_paint_task_handle_ = task_runner_->PostCancellableTask( | 1034 // Post a task with 1 ms delay to give a chance to run other immediate tasks |
| 1035 BLINK_FROM_HERE, WTF::Bind(&ScrollAnimatorMac::InitialScrollbarPaintTask, | 1035 // that may cancel this. |
| 1036 WrapWeakPersistent(this))); | 1036 initial_scrollbar_paint_task_handle_ = |
| 1037 task_runner_->PostDelayedCancellableTask( |
| 1038 BLINK_FROM_HERE, |
| 1039 WTF::Bind(&ScrollAnimatorMac::InitialScrollbarPaintTask, |
| 1040 WrapWeakPersistent(this)), |
| 1041 1); |
| 1037 } | 1042 } |
| 1038 | 1043 |
| 1039 bool ScrollAnimatorMac::ScrollbarPaintTimerIsActive() const { | 1044 bool ScrollAnimatorMac::ScrollbarPaintTimerIsActive() const { |
| 1040 return initial_scrollbar_paint_task_handle_.IsActive(); | 1045 return initial_scrollbar_paint_task_handle_.IsActive(); |
| 1041 } | 1046 } |
| 1042 | 1047 |
| 1043 void ScrollAnimatorMac::StopScrollbarPaintTimer() { | 1048 void ScrollAnimatorMac::StopScrollbarPaintTimer() { |
| 1044 initial_scrollbar_paint_task_handle_.Cancel(); | 1049 initial_scrollbar_paint_task_handle_.Cancel(); |
| 1045 } | 1050 } |
| 1046 | 1051 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 rect_in_view_coordinates = | 1086 rect_in_view_coordinates = |
| 1082 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb); | 1087 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb); |
| 1083 | 1088 |
| 1084 if (rect_in_view_coordinates == visible_scroller_thumb_rect_) | 1089 if (rect_in_view_coordinates == visible_scroller_thumb_rect_) |
| 1085 return; | 1090 return; |
| 1086 | 1091 |
| 1087 visible_scroller_thumb_rect_ = rect_in_view_coordinates; | 1092 visible_scroller_thumb_rect_ = rect_in_view_coordinates; |
| 1088 } | 1093 } |
| 1089 | 1094 |
| 1090 } // namespace blink | 1095 } // namespace blink |
| OLD | NEW |