OLD | NEW |
1 // Copyright (c) 2007-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2007-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 #include "config.h" | 5 #include "config.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
10 #include "CSSStyleSelector.h" | 10 #include "CSSStyleSelector.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // Firefox: pastes on up. | 542 // Firefox: pastes on up. |
543 // Midori: couldn't paste at all with 0.1.2 | 543 // Midori: couldn't paste at all with 0.1.2 |
544 // | 544 // |
545 // There is something of a webcompat angle to this well, as highlighted by | 545 // There is something of a webcompat angle to this well, as highlighted by |
546 // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on | 546 // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on |
547 // down then the text is pasted just before the onclick handler runs and | 547 // down then the text is pasted just before the onclick handler runs and |
548 // clears the text box. So it's important this happens after the | 548 // clears the text box. So it's important this happens after the |
549 // handleMouseReleaseEvent() earlier in this function | 549 // handleMouseReleaseEvent() earlier in this function |
550 if (event.button == WebMouseEvent::ButtonMiddle) { | 550 if (event.button == WebMouseEvent::ButtonMiddle) { |
551 Frame* focused = GetFocusedWebCoreFrame(); | 551 Frame* focused = GetFocusedWebCoreFrame(); |
552 if (focused) { | 552 IntPoint click_point(last_mouse_down_point_.x, last_mouse_down_point_.y); |
| 553 HitTestResult hit_test_result = |
| 554 focused->eventHandler()->hitTestResultAtPoint(click_point, false, false, |
| 555 ShouldHitTestScrollbars); |
| 556 if (!hit_test_result.scrollbar() && focused) { |
553 Editor* editor = focused->editor(); | 557 Editor* editor = focused->editor(); |
554 if (editor && editor->canEdit()) | 558 if (editor && editor->canEdit()) |
555 delegate_->PasteFromSelectionClipboard(); | 559 delegate_->PasteFromSelectionClipboard(); |
556 } | 560 } |
557 } | 561 } |
558 #endif | 562 #endif |
559 | 563 |
560 mouseCaptureLost(); | 564 mouseCaptureLost(); |
561 main_frame()->frame()->eventHandler()->handleMouseReleaseEvent( | 565 main_frame()->frame()->eventHandler()->handleMouseReleaseEvent( |
562 PlatformMouseEventBuilder(main_frame()->frameview(), event)); | 566 PlatformMouseEventBuilder(main_frame()->frameview(), event)); |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 | 1884 |
1881 return document->focusedNode(); | 1885 return document->focusedNode(); |
1882 } | 1886 } |
1883 | 1887 |
1884 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { | 1888 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { |
1885 IntPoint doc_point( | 1889 IntPoint doc_point( |
1886 page_->mainFrame()->view()->windowToContents(pos)); | 1890 page_->mainFrame()->view()->windowToContents(pos)); |
1887 return page_->mainFrame()->eventHandler()-> | 1891 return page_->mainFrame()->eventHandler()-> |
1888 hitTestResultAtPoint(doc_point, false); | 1892 hitTestResultAtPoint(doc_point, false); |
1889 } | 1893 } |
OLD | NEW |