| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 using namespace WebCore; | 94 using namespace WebCore; |
| 95 | 95 |
| 96 using WebKit::PlatformKeyboardEventBuilder; | 96 using WebKit::PlatformKeyboardEventBuilder; |
| 97 using WebKit::PlatformMouseEventBuilder; | 97 using WebKit::PlatformMouseEventBuilder; |
| 98 using WebKit::PlatformWheelEventBuilder; | 98 using WebKit::PlatformWheelEventBuilder; |
| 99 using WebKit::WebCanvas; | 99 using WebKit::WebCanvas; |
| 100 using WebKit::WebCompositionCommand; | 100 using WebKit::WebCompositionCommand; |
| 101 using WebKit::WebCompositionCommandConfirm; | 101 using WebKit::WebCompositionCommandConfirm; |
| 102 using WebKit::WebCompositionCommandDiscard; | 102 using WebKit::WebCompositionCommandDiscard; |
| 103 using WebKit::WebDragData; | 103 using WebKit::WebDragData; |
| 104 using WebKit::WebDragOperation; |
| 105 using WebKit::WebDragOperationCopy; |
| 106 using WebKit::WebDragOperationNone; |
| 107 using WebKit::WebDragOperationsMask; |
| 104 using WebKit::WebFrame; | 108 using WebKit::WebFrame; |
| 105 using WebKit::WebInputEvent; | 109 using WebKit::WebInputEvent; |
| 106 using WebKit::WebKeyboardEvent; | 110 using WebKit::WebKeyboardEvent; |
| 107 using WebKit::WebMouseEvent; | 111 using WebKit::WebMouseEvent; |
| 108 using WebKit::WebMouseWheelEvent; | 112 using WebKit::WebMouseWheelEvent; |
| 109 using WebKit::WebPoint; | 113 using WebKit::WebPoint; |
| 110 using WebKit::WebRect; | 114 using WebKit::WebRect; |
| 111 using WebKit::WebSettings; | 115 using WebKit::WebSettings; |
| 112 using WebKit::WebSettingsImpl; | 116 using WebKit::WebSettingsImpl; |
| 113 using WebKit::WebSize; | 117 using WebKit::WebSize; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 126 static const double kTextSizeMultiplierRatio = 1.2; | 130 static const double kTextSizeMultiplierRatio = 1.2; |
| 127 static const double kMinTextSizeMultiplier = 0.5; | 131 static const double kMinTextSizeMultiplier = 0.5; |
| 128 static const double kMaxTextSizeMultiplier = 3.0; | 132 static const double kMaxTextSizeMultiplier = 3.0; |
| 129 | 133 |
| 130 // The group name identifies a namespace of pages. Page group is used on OSX | 134 // The group name identifies a namespace of pages. Page group is used on OSX |
| 131 // for some programs that use HTML views to display things that don't seem like | 135 // for some programs that use HTML views to display things that don't seem like |
| 132 // web pages to the user (so shouldn't have visited link coloring). We only use | 136 // web pages to the user (so shouldn't have visited link coloring). We only use |
| 133 // one page group. | 137 // one page group. |
| 134 static const char* kPageGroupName = "default"; | 138 static const char* kPageGroupName = "default"; |
| 135 | 139 |
| 136 // The webcore drag operation type when something is trying to be dropped on | 140 // Ensure that the WebKit::WebDragOperation enum values stay in sync with |
| 137 // the webview. These values are taken from Apple's windows port. | 141 // the original WebCore::DragOperation constants. |
| 138 static const WebCore::DragOperation kDropTargetOperation = | 142 #define COMPILE_ASSERT_MATCHING_ENUM(webcore_name) \ |
| 139 static_cast<WebCore::DragOperation>(DragOperationCopy | DragOperationLink); | 143 COMPILE_ASSERT(int(WebCore::webcore_name) == int(WebKit::Web##webcore_name),\ |
| 144 dummy##webcore_name) |
| 145 COMPILE_ASSERT_MATCHING_ENUM(DragOperationNone); |
| 146 COMPILE_ASSERT_MATCHING_ENUM(DragOperationCopy); |
| 147 COMPILE_ASSERT_MATCHING_ENUM(DragOperationLink); |
| 148 COMPILE_ASSERT_MATCHING_ENUM(DragOperationGeneric); |
| 149 COMPILE_ASSERT_MATCHING_ENUM(DragOperationPrivate); |
| 150 COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove); |
| 151 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete); |
| 152 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); |
| 140 | 153 |
| 141 // AutocompletePopupMenuClient | 154 // AutocompletePopupMenuClient |
| 142 class AutocompletePopupMenuClient : public WebCore::PopupMenuClient { | 155 class AutocompletePopupMenuClient : public WebCore::PopupMenuClient { |
| 143 public: | 156 public: |
| 144 AutocompletePopupMenuClient(WebViewImpl* webview) : text_field_(NULL), | 157 AutocompletePopupMenuClient(WebViewImpl* webview) : text_field_(NULL), |
| 145 selected_index_(0), | 158 selected_index_(0), |
| 146 webview_(webview) { | 159 webview_(webview) { |
| 147 } | 160 } |
| 148 | 161 |
| 149 void Init(WebCore::HTMLInputElement* text_field, | 162 void Init(WebCore::HTMLInputElement* text_field, |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 zoom_level_(0), | 385 zoom_level_(0), |
| 373 context_menu_allowed_(false), | 386 context_menu_allowed_(false), |
| 374 doing_drag_and_drop_(false), | 387 doing_drag_and_drop_(false), |
| 375 ignore_input_events_(false), | 388 ignore_input_events_(false), |
| 376 suppress_next_keypress_event_(false), | 389 suppress_next_keypress_event_(false), |
| 377 initial_navigation_policy_(WebKit::WebNavigationPolicyIgnore), | 390 initial_navigation_policy_(WebKit::WebNavigationPolicyIgnore), |
| 378 ime_accept_events_(true), | 391 ime_accept_events_(true), |
| 379 drag_target_dispatch_(false), | 392 drag_target_dispatch_(false), |
| 380 drag_identity_(0), | 393 drag_identity_(0), |
| 381 drop_effect_(DROP_EFFECT_DEFAULT), | 394 drop_effect_(DROP_EFFECT_DEFAULT), |
| 382 drop_accept_(false), | 395 operations_allowed_(WebKit::WebDragOperationNone), |
| 396 drag_operation_(WebKit::WebDragOperationNone), |
| 383 autocomplete_popup_showing_(false), | 397 autocomplete_popup_showing_(false), |
| 384 is_transparent_(false) { | 398 is_transparent_(false) { |
| 385 // WebKit/win/WebView.cpp does the same thing, except they call the | 399 // WebKit/win/WebView.cpp does the same thing, except they call the |
| 386 // KJS specific wrapper around this method. We need to have threading | 400 // KJS specific wrapper around this method. We need to have threading |
| 387 // initialized because CollatorICU requires it. | 401 // initialized because CollatorICU requires it. |
| 388 WTF::initializeThreading(); | 402 WTF::initializeThreading(); |
| 389 | 403 |
| 390 // set to impossible point so we always get the first mouse pos | 404 // set to impossible point so we always get the first mouse pos |
| 391 last_mouse_position_ = WebPoint(-1, -1); | 405 last_mouse_position_ = WebPoint(-1, -1); |
| 392 | 406 |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 return; | 1506 return; |
| 1493 | 1507 |
| 1494 page_->inspectorController()->inspect(result.innerNonSharedNode()); | 1508 page_->inspectorController()->inspect(result.innerNonSharedNode()); |
| 1495 } | 1509 } |
| 1496 } | 1510 } |
| 1497 | 1511 |
| 1498 void WebViewImpl::ShowJavaScriptConsole() { | 1512 void WebViewImpl::ShowJavaScriptConsole() { |
| 1499 page_->inspectorController()->showPanel(InspectorController::ConsolePanel); | 1513 page_->inspectorController()->showPanel(InspectorController::ConsolePanel); |
| 1500 } | 1514 } |
| 1501 | 1515 |
| 1502 void WebViewImpl::DragSourceCancelledAt( | |
| 1503 const WebPoint& client_point, | |
| 1504 const WebPoint& screen_point) { | |
| 1505 PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point), | |
| 1506 webkit_glue::WebPointToIntPoint(screen_point), | |
| 1507 NoButton, MouseEventMoved, 0, false, false, false, | |
| 1508 false, 0); | |
| 1509 page_->mainFrame()->eventHandler()->dragSourceEndedAt(pme, DragOperationNone); | |
| 1510 } | |
| 1511 | |
| 1512 void WebViewImpl::DragSourceEndedAt( | 1516 void WebViewImpl::DragSourceEndedAt( |
| 1513 const WebPoint& client_point, | 1517 const WebPoint& client_point, |
| 1514 const WebPoint& screen_point) { | 1518 const WebPoint& screen_point, |
| 1519 WebDragOperation operation) { |
| 1515 PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point), | 1520 PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point), |
| 1516 webkit_glue::WebPointToIntPoint(screen_point), | 1521 webkit_glue::WebPointToIntPoint(screen_point), |
| 1517 LeftButton, MouseEventMoved, 0, false, false, false, | 1522 LeftButton, MouseEventMoved, 0, false, false, false, |
| 1518 false, 0); | 1523 false, 0); |
| 1519 page_->mainFrame()->eventHandler()->dragSourceEndedAt(pme, DragOperationCopy); | 1524 page_->mainFrame()->eventHandler()->dragSourceEndedAt(pme, |
| 1525 static_cast<WebCore::DragOperation>(operation)); |
| 1520 } | 1526 } |
| 1521 | 1527 |
| 1522 void WebViewImpl::DragSourceMovedTo( | 1528 void WebViewImpl::DragSourceMovedTo( |
| 1523 const WebPoint& client_point, | 1529 const WebPoint& client_point, |
| 1524 const WebPoint& screen_point) { | 1530 const WebPoint& screen_point) { |
| 1525 PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point), | 1531 PlatformMouseEvent pme(webkit_glue::WebPointToIntPoint(client_point), |
| 1526 webkit_glue::WebPointToIntPoint(screen_point), | 1532 webkit_glue::WebPointToIntPoint(screen_point), |
| 1527 LeftButton, MouseEventMoved, 0, false, false, false, | 1533 LeftButton, MouseEventMoved, 0, false, false, false, |
| 1528 false, 0); | 1534 false, 0); |
| 1529 page_->mainFrame()->eventHandler()->dragSourceMovedTo(pme); | 1535 page_->mainFrame()->eventHandler()->dragSourceMovedTo(pme); |
| 1530 } | 1536 } |
| 1531 | 1537 |
| 1532 void WebViewImpl::DragSourceSystemDragEnded() { | 1538 void WebViewImpl::DragSourceSystemDragEnded() { |
| 1533 // It's possible for us to get this callback while not doing a drag if | 1539 // It's possible for us to get this callback while not doing a drag if |
| 1534 // it's from a previous page that got unloaded. | 1540 // it's from a previous page that got unloaded. |
| 1535 if (doing_drag_and_drop_) { | 1541 if (doing_drag_and_drop_) { |
| 1536 page_->dragController()->dragEnded(); | 1542 page_->dragController()->dragEnded(); |
| 1537 doing_drag_and_drop_ = false; | 1543 doing_drag_and_drop_ = false; |
| 1538 } | 1544 } |
| 1539 } | 1545 } |
| 1540 | 1546 |
| 1541 bool WebViewImpl::DragTargetDragEnter( | 1547 WebDragOperation WebViewImpl::DragTargetDragEnter( |
| 1542 const WebDragData& web_drag_data, | 1548 const WebDragData& web_drag_data, |
| 1543 int identity, | 1549 int identity, |
| 1544 const WebPoint& client_point, | 1550 const WebPoint& client_point, |
| 1545 const WebPoint& screen_point) { | 1551 const WebPoint& screen_point, |
| 1552 WebDragOperation operations_allowed) { |
| 1546 DCHECK(!current_drag_data_.get()); | 1553 DCHECK(!current_drag_data_.get()); |
| 1547 | 1554 |
| 1548 current_drag_data_ = | 1555 current_drag_data_ = |
| 1549 webkit_glue::WebDragDataToChromiumDataObject(web_drag_data); | 1556 webkit_glue::WebDragDataToChromiumDataObject(web_drag_data); |
| 1550 drag_identity_ = identity; | 1557 drag_identity_ = identity; |
| 1558 operations_allowed_ = operations_allowed; |
| 1551 | 1559 |
| 1552 DragData drag_data( | 1560 DragData drag_data( |
| 1553 current_drag_data_.get(), | 1561 current_drag_data_.get(), |
| 1554 webkit_glue::WebPointToIntPoint(client_point), | 1562 webkit_glue::WebPointToIntPoint(client_point), |
| 1555 webkit_glue::WebPointToIntPoint(screen_point), | 1563 webkit_glue::WebPointToIntPoint(screen_point), |
| 1556 kDropTargetOperation); | 1564 static_cast<WebCore::DragOperation>(operations_allowed)); |
| 1557 | 1565 |
| 1558 drop_effect_ = DROP_EFFECT_DEFAULT; | 1566 drop_effect_ = DROP_EFFECT_DEFAULT; |
| 1559 drag_target_dispatch_ = true; | 1567 drag_target_dispatch_ = true; |
| 1560 DragOperation effect = page_->dragController()->dragEntered(&drag_data); | 1568 DragOperation effect = page_->dragController()->dragEntered(&drag_data); |
| 1569 // Mask the operation against the drag source's allowed operations. |
| 1570 if ((effect & drag_data.draggingSourceOperationMask()) != effect) { |
| 1571 effect = DragOperationNone; |
| 1572 } |
| 1561 drag_target_dispatch_ = false; | 1573 drag_target_dispatch_ = false; |
| 1562 | 1574 |
| 1563 if (drop_effect_ != DROP_EFFECT_DEFAULT) | 1575 if (drop_effect_ != DROP_EFFECT_DEFAULT) |
| 1564 return drop_accept_ = (drop_effect_ != DROP_EFFECT_NONE); | 1576 drag_operation_ = (drop_effect_ != DROP_EFFECT_NONE) ? |
| 1565 return drop_accept_ = (effect != DragOperationNone); | 1577 WebDragOperationCopy : WebDragOperationNone; |
| 1578 else |
| 1579 drag_operation_ = static_cast<WebDragOperation>(effect); |
| 1580 return drag_operation_; |
| 1566 } | 1581 } |
| 1567 | 1582 |
| 1568 bool WebViewImpl::DragTargetDragOver( | 1583 WebDragOperation WebViewImpl::DragTargetDragOver( |
| 1569 const WebPoint& client_point, | 1584 const WebPoint& client_point, |
| 1570 const WebPoint& screen_point) { | 1585 const WebPoint& screen_point, |
| 1586 WebDragOperation operations_allowed) { |
| 1571 DCHECK(current_drag_data_.get()); | 1587 DCHECK(current_drag_data_.get()); |
| 1572 | 1588 |
| 1589 operations_allowed_ = operations_allowed; |
| 1573 DragData drag_data( | 1590 DragData drag_data( |
| 1574 current_drag_data_.get(), | 1591 current_drag_data_.get(), |
| 1575 webkit_glue::WebPointToIntPoint(client_point), | 1592 webkit_glue::WebPointToIntPoint(client_point), |
| 1576 webkit_glue::WebPointToIntPoint(screen_point), | 1593 webkit_glue::WebPointToIntPoint(screen_point), |
| 1577 kDropTargetOperation); | 1594 static_cast<WebCore::DragOperation>(operations_allowed)); |
| 1578 | 1595 |
| 1579 drop_effect_ = DROP_EFFECT_DEFAULT; | 1596 drop_effect_ = DROP_EFFECT_DEFAULT; |
| 1580 drag_target_dispatch_ = true; | 1597 drag_target_dispatch_ = true; |
| 1581 DragOperation effect = page_->dragController()->dragUpdated(&drag_data); | 1598 DragOperation effect = page_->dragController()->dragUpdated(&drag_data); |
| 1599 // Mask the operation against the drag source's allowed operations. |
| 1600 if ((effect & drag_data.draggingSourceOperationMask()) != effect) { |
| 1601 effect = DragOperationNone; |
| 1602 } |
| 1582 drag_target_dispatch_ = false; | 1603 drag_target_dispatch_ = false; |
| 1583 | 1604 |
| 1584 if (drop_effect_ != DROP_EFFECT_DEFAULT) | 1605 if (drop_effect_ != DROP_EFFECT_DEFAULT) |
| 1585 return drop_accept_ = (drop_effect_ != DROP_EFFECT_NONE); | 1606 drag_operation_ = (drop_effect_ != DROP_EFFECT_NONE) ? |
| 1586 return drop_accept_ = (effect != DragOperationNone); | 1607 WebDragOperationCopy : WebDragOperationNone; |
| 1608 else |
| 1609 drag_operation_ = static_cast<WebDragOperation>(effect); |
| 1610 return drag_operation_; |
| 1587 } | 1611 } |
| 1588 | 1612 |
| 1589 void WebViewImpl::DragTargetDragLeave() { | 1613 void WebViewImpl::DragTargetDragLeave() { |
| 1590 DCHECK(current_drag_data_.get()); | 1614 DCHECK(current_drag_data_.get()); |
| 1591 | 1615 |
| 1592 DragData drag_data( | 1616 DragData drag_data( |
| 1593 current_drag_data_.get(), | 1617 current_drag_data_.get(), |
| 1594 IntPoint(), | 1618 IntPoint(), |
| 1595 IntPoint(), | 1619 IntPoint(), |
| 1596 kDropTargetOperation); | 1620 static_cast<WebCore::DragOperation>(operations_allowed_)); |
| 1597 | 1621 |
| 1598 drag_target_dispatch_ = true; | 1622 drag_target_dispatch_ = true; |
| 1599 page_->dragController()->dragExited(&drag_data); | 1623 page_->dragController()->dragExited(&drag_data); |
| 1600 drag_target_dispatch_ = false; | 1624 drag_target_dispatch_ = false; |
| 1601 | 1625 |
| 1602 current_drag_data_ = NULL; | 1626 current_drag_data_ = NULL; |
| 1603 drop_effect_ = DROP_EFFECT_DEFAULT; | 1627 drop_effect_ = DROP_EFFECT_DEFAULT; |
| 1604 drop_accept_ = false; | 1628 drag_operation_ = WebDragOperationNone; |
| 1605 drag_identity_ = 0; | 1629 drag_identity_ = 0; |
| 1606 } | 1630 } |
| 1607 | 1631 |
| 1608 void WebViewImpl::DragTargetDrop( | 1632 void WebViewImpl::DragTargetDrop( |
| 1609 const WebPoint& client_point, | 1633 const WebPoint& client_point, |
| 1610 const WebPoint& screen_point) { | 1634 const WebPoint& screen_point) { |
| 1611 DCHECK(current_drag_data_.get()); | 1635 DCHECK(current_drag_data_.get()); |
| 1612 | 1636 |
| 1613 // If this webview transitions from the "drop accepting" state to the "not | 1637 // If this webview transitions from the "drop accepting" state to the "not |
| 1614 // accepting" state, then our IPC message reply indicating that may be in- | 1638 // accepting" state, then our IPC message reply indicating that may be in- |
| 1615 // flight, or else delayed by javascript processing in this webview. If a | 1639 // flight, or else delayed by javascript processing in this webview. If a |
| 1616 // drop happens before our IPC reply has reached the browser process, then | 1640 // drop happens before our IPC reply has reached the browser process, then |
| 1617 // the browser forwards the drop to this webview. So only allow a drop to | 1641 // the browser forwards the drop to this webview. So only allow a drop to |
| 1618 // proceed if our webview drop_accept_ state is true. | 1642 // proceed if our webview drag_operation_ state is not DragOperationNone. |
| 1619 | 1643 |
| 1620 if (!drop_accept_) { // IPC RACE CONDITION: do not allow this drop. | 1644 if (drag_operation_ == WebDragOperationNone) { // IPC RACE CONDITION: do not
allow this drop. |
| 1621 DragTargetDragLeave(); | 1645 DragTargetDragLeave(); |
| 1622 return; | 1646 return; |
| 1623 } | 1647 } |
| 1624 | 1648 |
| 1625 DragData drag_data( | 1649 DragData drag_data( |
| 1626 current_drag_data_.get(), | 1650 current_drag_data_.get(), |
| 1627 webkit_glue::WebPointToIntPoint(client_point), | 1651 webkit_glue::WebPointToIntPoint(client_point), |
| 1628 webkit_glue::WebPointToIntPoint(screen_point), | 1652 webkit_glue::WebPointToIntPoint(screen_point), |
| 1629 kDropTargetOperation); | 1653 static_cast<WebCore::DragOperation>(operations_allowed_)); |
| 1630 | 1654 |
| 1631 drag_target_dispatch_ = true; | 1655 drag_target_dispatch_ = true; |
| 1632 page_->dragController()->performDrag(&drag_data); | 1656 page_->dragController()->performDrag(&drag_data); |
| 1633 drag_target_dispatch_ = false; | 1657 drag_target_dispatch_ = false; |
| 1634 | 1658 |
| 1635 current_drag_data_ = NULL; | 1659 current_drag_data_ = NULL; |
| 1636 drop_effect_ = DROP_EFFECT_DEFAULT; | 1660 drop_effect_ = DROP_EFFECT_DEFAULT; |
| 1637 drop_accept_ = false; | 1661 drag_operation_ = WebDragOperationNone; |
| 1638 drag_identity_ = 0; | 1662 drag_identity_ = 0; |
| 1639 } | 1663 } |
| 1640 | 1664 |
| 1641 int32 WebViewImpl::GetDragIdentity() { | 1665 int32 WebViewImpl::GetDragIdentity() { |
| 1642 if (drag_target_dispatch_) | 1666 if (drag_target_dispatch_) |
| 1643 return drag_identity_; | 1667 return drag_identity_; |
| 1644 return 0; | 1668 return 0; |
| 1645 } | 1669 } |
| 1646 | 1670 |
| 1647 bool WebViewImpl::SetDropEffect(bool accept) { | 1671 bool WebViewImpl::SetDropEffect(bool accept) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 *is_new_navigation = observed_new_navigation_; | 1816 *is_new_navigation = observed_new_navigation_; |
| 1793 | 1817 |
| 1794 #ifndef NDEBUG | 1818 #ifndef NDEBUG |
| 1795 DCHECK(!observed_new_navigation_ || | 1819 DCHECK(!observed_new_navigation_ || |
| 1796 page_->mainFrame()->loader()->documentLoader() == new_navigation_loader_); | 1820 page_->mainFrame()->loader()->documentLoader() == new_navigation_loader_); |
| 1797 new_navigation_loader_ = NULL; | 1821 new_navigation_loader_ = NULL; |
| 1798 #endif | 1822 #endif |
| 1799 observed_new_navigation_ = false; | 1823 observed_new_navigation_ = false; |
| 1800 } | 1824 } |
| 1801 | 1825 |
| 1802 void WebViewImpl::StartDragging(const WebDragData& drag_data) { | 1826 void WebViewImpl::StartDragging(WebPoint event_pos, |
| 1827 const WebDragData& drag_data, |
| 1828 WebDragOperationsMask mask) { |
| 1803 if (delegate_) { | 1829 if (delegate_) { |
| 1804 DCHECK(!doing_drag_and_drop_); | 1830 DCHECK(!doing_drag_and_drop_); |
| 1805 doing_drag_and_drop_ = true; | 1831 doing_drag_and_drop_ = true; |
| 1806 delegate_->StartDragging(this, drag_data); | 1832 delegate_->StartDragging(this, event_pos, drag_data, mask); |
| 1807 } | 1833 } |
| 1808 } | 1834 } |
| 1809 | 1835 |
| 1810 void WebViewImpl::OnImageFetchComplete(ImageResourceFetcher* fetcher, | 1836 void WebViewImpl::OnImageFetchComplete(ImageResourceFetcher* fetcher, |
| 1811 const SkBitmap& image) { | 1837 const SkBitmap& image) { |
| 1812 if (delegate_) { | 1838 if (delegate_) { |
| 1813 delegate_->DidDownloadImage(fetcher->id(), fetcher->image_url(), | 1839 delegate_->DidDownloadImage(fetcher->id(), fetcher->image_url(), |
| 1814 image.isNull(), image); | 1840 image.isNull(), image); |
| 1815 } | 1841 } |
| 1816 DeleteImageResourceFetcher(fetcher); | 1842 DeleteImageResourceFetcher(fetcher); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 | 1927 |
| 1902 return document->focusedNode(); | 1928 return document->focusedNode(); |
| 1903 } | 1929 } |
| 1904 | 1930 |
| 1905 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { | 1931 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { |
| 1906 IntPoint doc_point( | 1932 IntPoint doc_point( |
| 1907 page_->mainFrame()->view()->windowToContents(pos)); | 1933 page_->mainFrame()->view()->windowToContents(pos)); |
| 1908 return page_->mainFrame()->eventHandler()-> | 1934 return page_->mainFrame()->eventHandler()-> |
| 1909 hitTestResultAtPoint(doc_point, false); | 1935 hitTestResultAtPoint(doc_point, false); |
| 1910 } | 1936 } |
| OLD | NEW |