| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if (layout_object && layout_object->IsBox() && | 359 if (layout_object && layout_object->IsBox() && |
| 360 ToLayoutBox(layout_object)->CanBeScrolledAndHasScrollableArea()) | 360 ToLayoutBox(layout_object)->CanBeScrolledAndHasScrollableArea()) |
| 361 result = ToLayoutBox(layout_object)->Scroll(kScrollByPixel, delta); | 361 result = ToLayoutBox(layout_object)->Scroll(kScrollByPixel, delta); |
| 362 } | 362 } |
| 363 if (result.DidScroll()) { | 363 if (result.DidScroll()) { |
| 364 did_latch_for_middle_click_autoscroll_ = true; | 364 did_latch_for_middle_click_autoscroll_ = true; |
| 365 autoscroll_layout_object_ = ToLayoutBox(layout_object); | 365 autoscroll_layout_object_ = ToLayoutBox(layout_object); |
| 366 } | 366 } |
| 367 break; | 367 break; |
| 368 } | 368 } |
| 369 if (autoscroll_type_ != kNoAutoscroll && autoscroll_layout_object_) | 369 if (autoscroll_type_ != kNoAutoscroll && autoscroll_layout_object_) { |
| 370 page_->GetChromeClient().ScheduleAnimation( | 370 page_->GetChromeClient().ScheduleAnimation( |
| 371 autoscroll_layout_object_->GetFrame()->View()); | 371 autoscroll_layout_object_->GetFrame()); |
| 372 } |
| 372 } | 373 } |
| 373 | 374 |
| 374 void AutoscrollController::StartAutoscroll() { | 375 void AutoscrollController::StartAutoscroll() { |
| 375 page_->GetChromeClient().ScheduleAnimation( | 376 page_->GetChromeClient().ScheduleAnimation( |
| 376 autoscroll_layout_object_->GetFrame()->View()); | 377 autoscroll_layout_object_->GetFrame()); |
| 377 } | 378 } |
| 378 | 379 |
| 379 void AutoscrollController::UpdateMiddleClickAutoscrollState( | 380 void AutoscrollController::UpdateMiddleClickAutoscrollState( |
| 380 FrameView* view, | 381 FrameView* view, |
| 381 const IntPoint& last_known_mouse_position) { | 382 const IntPoint& last_known_mouse_position) { |
| 382 DCHECK(RuntimeEnabledFeatures::middleClickAutoscrollEnabled()); | 383 DCHECK(RuntimeEnabledFeatures::middleClickAutoscrollEnabled()); |
| 383 // At the original click location we draw a 4 arrowed icon. Over this icon | 384 // At the original click location we draw a 4 arrowed icon. Over this icon |
| 384 // there won't be any scroll, So don't change the cursor over this area. | 385 // there won't be any scroll, So don't change the cursor over this area. |
| 385 bool east = middle_click_autoscroll_start_pos_.X() < | 386 bool east = middle_click_autoscroll_start_pos_.X() < |
| 386 (last_known_mouse_position.X() - kNoMiddleClickAutoscrollRadius); | 387 (last_known_mouse_position.X() - kNoMiddleClickAutoscrollRadius); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 412 } else if (east) { | 413 } else if (east) { |
| 413 view->SetCursor(EastPanningCursor()); | 414 view->SetCursor(EastPanningCursor()); |
| 414 } else if (west) { | 415 } else if (west) { |
| 415 view->SetCursor(WestPanningCursor()); | 416 view->SetCursor(WestPanningCursor()); |
| 416 } else { | 417 } else { |
| 417 view->SetCursor(MiddlePanningCursor()); | 418 view->SetCursor(MiddlePanningCursor()); |
| 418 } | 419 } |
| 419 } | 420 } |
| 420 | 421 |
| 421 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |