| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file contains the definition for EventSendingController. | 5 // This file contains the definition for EventSendingController. |
| 6 // | 6 // |
| 7 // Some notes about drag and drop handling: | 7 // Some notes about drag and drop handling: |
| 8 // Windows drag and drop goes through a system call to DoDragDrop. At that | 8 // Windows drag and drop goes through a system call to DoDragDrop. At that |
| 9 // point, program control is given to Windows which then periodically makes | 9 // point, program control is given to Windows which then periodically makes |
| 10 // callbacks into the webview. This won't work for layout tests, so instead, | 10 // callbacks into the webview. This won't work for layout tests, so instead, |
| 11 // we queue up all the mouse move and mouse up events. When the test tries to | 11 // we queue up all the mouse move and mouse up events. When the test tries to |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 609 |
| 610 // static | 610 // static |
| 611 void EventSendingController::DoLeapForward(int milliseconds) { | 611 void EventSendingController::DoLeapForward(int milliseconds) { |
| 612 AdvanceEventTime(milliseconds); | 612 AdvanceEventTime(milliseconds); |
| 613 } | 613 } |
| 614 | 614 |
| 615 // Apple's port of WebKit zooms by a factor of 1.2 (see | 615 // Apple's port of WebKit zooms by a factor of 1.2 (see |
| 616 // WebKit/WebView/WebView.mm) | 616 // WebKit/WebView/WebView.mm) |
| 617 void EventSendingController::textZoomIn( | 617 void EventSendingController::textZoomIn( |
| 618 const CppArgumentList& args, CppVariant* result) { | 618 const CppArgumentList& args, CppVariant* result) { |
| 619 webview()->zoomIn(true); | 619 webview()->setZoomLevel(true, webview()->zoomLevel() + 1); |
| 620 result->SetNull(); | 620 result->SetNull(); |
| 621 } | 621 } |
| 622 | 622 |
| 623 void EventSendingController::textZoomOut( | 623 void EventSendingController::textZoomOut( |
| 624 const CppArgumentList& args, CppVariant* result) { | 624 const CppArgumentList& args, CppVariant* result) { |
| 625 webview()->zoomOut(true); | 625 webview()->setZoomLevel(true, webview()->zoomLevel() - 1); |
| 626 result->SetNull(); | 626 result->SetNull(); |
| 627 } | 627 } |
| 628 | 628 |
| 629 void EventSendingController::zoomPageIn( | 629 void EventSendingController::zoomPageIn( |
| 630 const CppArgumentList& args, CppVariant* result) { | 630 const CppArgumentList& args, CppVariant* result) { |
| 631 webview()->zoomIn(false); | 631 webview()->setZoomLevel(false, webview()->zoomLevel() + 1); |
| 632 result->SetNull(); | 632 result->SetNull(); |
| 633 } | 633 } |
| 634 | 634 |
| 635 void EventSendingController::zoomPageOut( | 635 void EventSendingController::zoomPageOut( |
| 636 const CppArgumentList& args, CppVariant* result) { | 636 const CppArgumentList& args, CppVariant* result) { |
| 637 webview()->zoomOut(false); | 637 webview()->setZoomLevel(false, webview()->zoomLevel() - 1); |
| 638 result->SetNull(); | 638 result->SetNull(); |
| 639 } | 639 } |
| 640 | 640 |
| 641 void EventSendingController::ReplaySavedEvents() { | 641 void EventSendingController::ReplaySavedEvents() { |
| 642 replaying_saved_events = true; | 642 replaying_saved_events = true; |
| 643 while (!mouse_event_queue.empty()) { | 643 while (!mouse_event_queue.empty()) { |
| 644 SavedEvent e = mouse_event_queue.front(); | 644 SavedEvent e = mouse_event_queue.front(); |
| 645 mouse_event_queue.pop(); | 645 mouse_event_queue.pop(); |
| 646 | 646 |
| 647 switch (e.type) { | 647 switch (e.type) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 void EventSendingController::fireKeyboardEventsToElement( | 745 void EventSendingController::fireKeyboardEventsToElement( |
| 746 const CppArgumentList& args, CppVariant* result) { | 746 const CppArgumentList& args, CppVariant* result) { |
| 747 result->SetNull(); | 747 result->SetNull(); |
| 748 } | 748 } |
| 749 | 749 |
| 750 void EventSendingController::clearKillRing( | 750 void EventSendingController::clearKillRing( |
| 751 const CppArgumentList& args, CppVariant* result) { | 751 const CppArgumentList& args, CppVariant* result) { |
| 752 result->SetNull(); | 752 result->SetNull(); |
| 753 } | 753 } |
| OLD | NEW |