| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on | 557 // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on |
| 558 // down then the text is pasted just before the onclick handler runs and | 558 // down then the text is pasted just before the onclick handler runs and |
| 559 // clears the text box. So it's important this happens after the | 559 // clears the text box. So it's important this happens after the |
| 560 // handleMouseReleaseEvent() earlier in this function | 560 // handleMouseReleaseEvent() earlier in this function |
| 561 if (event.button == WebMouseEvent::ButtonMiddle) { | 561 if (event.button == WebMouseEvent::ButtonMiddle) { |
| 562 Frame* focused = GetFocusedWebCoreFrame(); | 562 Frame* focused = GetFocusedWebCoreFrame(); |
| 563 IntPoint click_point(last_mouse_down_point_.x, last_mouse_down_point_.y); | 563 IntPoint click_point(last_mouse_down_point_.x, last_mouse_down_point_.y); |
| 564 HitTestResult hit_test_result = | 564 HitTestResult hit_test_result = |
| 565 focused->eventHandler()->hitTestResultAtPoint(click_point, false, false, | 565 focused->eventHandler()->hitTestResultAtPoint(click_point, false, false, |
| 566 ShouldHitTestScrollbars); | 566 ShouldHitTestScrollbars); |
| 567 if (!hit_test_result.scrollbar() && focused) { | 567 // We don't want to send a paste when middle clicking a scroll bar or a |
| 568 // link (which will navigate later in the code). |
| 569 if (!hit_test_result.scrollbar() && !hit_test_result.isLiveLink() && |
| 570 focused) { |
| 568 Editor* editor = focused->editor(); | 571 Editor* editor = focused->editor(); |
| 569 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); | 572 Pasteboard* pasteboard = Pasteboard::generalPasteboard(); |
| 570 bool oldSelectionMode = pasteboard->isSelectionMode(); | 573 bool oldSelectionMode = pasteboard->isSelectionMode(); |
| 571 pasteboard->setSelectionMode(true); | 574 pasteboard->setSelectionMode(true); |
| 572 editor->command(AtomicString("Paste")).execute(); | 575 editor->command(AtomicString("Paste")).execute(); |
| 573 pasteboard->setSelectionMode(oldSelectionMode); | 576 pasteboard->setSelectionMode(oldSelectionMode); |
| 574 } | 577 } |
| 575 } | 578 } |
| 576 #endif | 579 #endif |
| 577 | 580 |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 return spelling_panel_is_visible_; | 1906 return spelling_panel_is_visible_; |
| 1904 } | 1907 } |
| 1905 | 1908 |
| 1906 void WebViewImpl::setTabsToLinks(bool enable) { | 1909 void WebViewImpl::setTabsToLinks(bool enable) { |
| 1907 tabs_to_links_ = enable; | 1910 tabs_to_links_ = enable; |
| 1908 } | 1911 } |
| 1909 | 1912 |
| 1910 bool WebViewImpl::tabsToLinks() const { | 1913 bool WebViewImpl::tabsToLinks() const { |
| 1911 return tabs_to_links_; | 1914 return tabs_to_links_; |
| 1912 } | 1915 } |
| OLD | NEW |