OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 6 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 StopAutoscroll(); | 185 StopAutoscroll(); |
186 return; | 186 return; |
187 } | 187 } |
188 | 188 |
189 drag_and_drop_autoscroll_reference_position_ = event_position + offset; | 189 drag_and_drop_autoscroll_reference_position_ = event_position + offset; |
190 | 190 |
191 if (autoscroll_type_ == kNoAutoscroll) { | 191 if (autoscroll_type_ == kNoAutoscroll) { |
192 autoscroll_type_ = kAutoscrollForDragAndDrop; | 192 autoscroll_type_ = kAutoscrollForDragAndDrop; |
193 autoscroll_layout_object_ = scrollable; | 193 autoscroll_layout_object_ = scrollable; |
194 drag_and_drop_autoscroll_start_time_ = event_time; | 194 drag_and_drop_autoscroll_start_time_ = event_time; |
195 UseCounter::Count(page_->MainFrame(), UseCounter::kDragAndDropScrollStart); | 195 UseCounter::Count(autoscroll_layout_object_->GetFrame(), |
| 196 UseCounter::kDragAndDropScrollStart); |
196 StartAutoscroll(); | 197 StartAutoscroll(); |
197 } else if (autoscroll_layout_object_ != scrollable) { | 198 } else if (autoscroll_layout_object_ != scrollable) { |
198 drag_and_drop_autoscroll_start_time_ = event_time; | 199 drag_and_drop_autoscroll_start_time_ = event_time; |
199 autoscroll_layout_object_ = scrollable; | 200 autoscroll_layout_object_ = scrollable; |
200 } | 201 } |
201 } | 202 } |
202 | 203 |
203 void AutoscrollController::HandleMouseReleaseForMiddleClickAutoscroll( | 204 void AutoscrollController::HandleMouseReleaseForMiddleClickAutoscroll( |
204 LocalFrame* frame, | 205 LocalFrame* frame, |
205 const WebMouseEvent& mouse_event) { | 206 const WebMouseEvent& mouse_event) { |
(...skipping 28 matching lines...) Expand all Loading... |
234 // We don't want to trigger the autoscroll or the middleClickAutoscroll if | 235 // We don't want to trigger the autoscroll or the middleClickAutoscroll if |
235 // it's already active. | 236 // it's already active. |
236 if (autoscroll_type_ != kNoAutoscroll) | 237 if (autoscroll_type_ != kNoAutoscroll) |
237 return; | 238 return; |
238 | 239 |
239 autoscroll_type_ = kAutoscrollForMiddleClick; | 240 autoscroll_type_ = kAutoscrollForMiddleClick; |
240 autoscroll_layout_object_ = scrollable; | 241 autoscroll_layout_object_ = scrollable; |
241 middle_click_autoscroll_start_pos_ = last_known_mouse_position; | 242 middle_click_autoscroll_start_pos_ = last_known_mouse_position; |
242 did_latch_for_middle_click_autoscroll_ = false; | 243 did_latch_for_middle_click_autoscroll_ = false; |
243 | 244 |
244 UseCounter::Count(page_->MainFrame(), | 245 UseCounter::Count(autoscroll_layout_object_->GetFrame(), |
245 UseCounter::kMiddleClickAutoscrollStart); | 246 UseCounter::kMiddleClickAutoscrollStart); |
246 StartAutoscroll(); | 247 StartAutoscroll(); |
247 } | 248 } |
248 | 249 |
249 static inline int AdjustedScrollDelta(int beginning_delta) { | 250 static inline int AdjustedScrollDelta(int beginning_delta) { |
250 // This implemention matches Firefox's. | 251 // This implemention matches Firefox's. |
251 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml#8
56. | 252 // http://mxr.mozilla.org/firefox/source/toolkit/content/widgets/browser.xml#8
56. |
252 const int kSpeedReducer = 12; | 253 const int kSpeedReducer = 12; |
253 | 254 |
254 int adjusted_delta = beginning_delta / kSpeedReducer; | 255 int adjusted_delta = beginning_delta / kSpeedReducer; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } else if (east) { | 412 } else if (east) { |
412 view->SetCursor(EastPanningCursor()); | 413 view->SetCursor(EastPanningCursor()); |
413 } else if (west) { | 414 } else if (west) { |
414 view->SetCursor(WestPanningCursor()); | 415 view->SetCursor(WestPanningCursor()); |
415 } else { | 416 } else { |
416 view->SetCursor(MiddlePanningCursor()); | 417 view->SetCursor(MiddlePanningCursor()); |
417 } | 418 } |
418 } | 419 } |
419 | 420 |
420 } // namespace blink | 421 } // namespace blink |
OLD | NEW |