| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // If the enumeration can't happen, call the callback with an empty list. | 725 // If the enumeration can't happen, call the callback with an empty list. |
| 726 if (!client->enumerateChosenDirectory(fileChooser->settings().selectedFiles[
0], chooserCompletion)) | 726 if (!client->enumerateChosenDirectory(fileChooser->settings().selectedFiles[
0], chooserCompletion)) |
| 727 chooserCompletion->didChooseFile(WebVector<WebString>()); | 727 chooserCompletion->didChooseFile(WebVector<WebString>()); |
| 728 } | 728 } |
| 729 | 729 |
| 730 Cursor ChromeClientImpl::lastSetCursorForTesting() const | 730 Cursor ChromeClientImpl::lastSetCursorForTesting() const |
| 731 { | 731 { |
| 732 return m_lastSetMouseCursorForTesting; | 732 return m_lastSetMouseCursorForTesting; |
| 733 } | 733 } |
| 734 | 734 |
| 735 void ChromeClientImpl::setCursor(const Cursor& cursor, LocalFrame* localRoot) | 735 void ChromeClientImpl::setCursor(const Cursor& cursor, LocalFrame* localFrame) |
| 736 { | 736 { |
| 737 m_lastSetMouseCursorForTesting = cursor; | 737 m_lastSetMouseCursorForTesting = cursor; |
| 738 setCursor(WebCursorInfo(cursor), localRoot); | 738 setCursor(WebCursorInfo(cursor), localFrame); |
| 739 } | 739 } |
| 740 | 740 |
| 741 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localR
oot) | 741 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localF
rame) |
| 742 { | 742 { |
| 743 if (m_cursorOverridden) | 743 if (m_cursorOverridden) |
| 744 return; | 744 return; |
| 745 | 745 |
| 746 #if OS(MACOSX) | 746 #if OS(MACOSX) |
| 747 // On Mac the mousemove event propagates to both the popup and main window. | 747 // On Mac the mousemove event propagates to both the popup and main window. |
| 748 // If a popup is open we don't want the main window to change the cursor. | 748 // If a popup is open we don't want the main window to change the cursor. |
| 749 if (m_webView->hasOpenedPopup()) | 749 if (m_webView->hasOpenedPopup()) |
| 750 return; | 750 return; |
| 751 #endif | 751 #endif |
| 752 if (!m_webView->client()) | 752 |
| 753 return; | 753 LocalFrame* localRoot = localFrame->localFrameRoot(); |
| 754 // TODO(kenrb, dcheng): For top-level frames we still use the WebView as | 754 if (WebFrameWidget* widget = WebLocalFrameImpl::fromFrame(localRoot)->frameW
idget()) |
| 755 // a WebWidget. This special case will be removed when top-level frames | 755 widget->client()->didChangeCursor(cursor); |
| 756 // get WebFrameWidgets. | |
| 757 if (localRoot->isMainFrame()) { | |
| 758 m_webView->client()->didChangeCursor(cursor); | |
| 759 } else { | |
| 760 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot); | |
| 761 DCHECK(webFrame); | |
| 762 DCHECK(webFrame->frameWidget()); | |
| 763 if (toWebFrameWidgetImpl(webFrame->frameWidget())->client()) | |
| 764 toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCu
rsor(cursor); | |
| 765 } | |
| 766 } | 756 } |
| 767 | 757 |
| 768 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor, LocalFram
e* localRoot) | 758 void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor, LocalFram
e* localFrame) |
| 769 { | 759 { |
| 770 setCursor(cursor, localRoot); | 760 setCursor(cursor, localFrame); |
| 771 } | 761 } |
| 772 | 762 |
| 773 void ChromeClientImpl::setCursorOverridden(bool overridden) | 763 void ChromeClientImpl::setCursorOverridden(bool overridden) |
| 774 { | 764 { |
| 775 m_cursorOverridden = overridden; | 765 m_cursorOverridden = overridden; |
| 776 } | 766 } |
| 777 | 767 |
| 778 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach
e::AXNotification notification) | 768 void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCach
e::AXNotification notification) |
| 779 { | 769 { |
| 780 // Alert assistive technology about the accessibility object notification. | 770 // Alert assistive technology about the accessibility object notification. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 { | 1079 { |
| 1090 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext)
.release()); | 1080 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext)
.release()); |
| 1091 } | 1081 } |
| 1092 | 1082 |
| 1093 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1083 double ChromeClientImpl::lastFrameTimeMonotonic() const |
| 1094 { | 1084 { |
| 1095 return m_webView->lastFrameTimeMonotonic(); | 1085 return m_webView->lastFrameTimeMonotonic(); |
| 1096 } | 1086 } |
| 1097 | 1087 |
| 1098 } // namespace blink | 1088 } // namespace blink |
| OLD | NEW |