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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // WebCore::Node. | 233 // WebCore::Node. |
234 HitTestResult hitTest(IntPoint(0, 0)); | 234 HitTestResult hitTest(IntPoint(0, 0)); |
235 // This cast must be valid because of the isLink() check. | 235 // This cast must be valid because of the isLink() check. |
236 hitTest.setURLElement(toElement(node)); | 236 hitTest.setURLElement(toElement(node)); |
237 if (hitTest.isLiveLink()) | 237 if (hitTest.isLiveLink()) |
238 focusURL = hitTest.absoluteLinkURL(); | 238 focusURL = hitTest.absoluteLinkURL(); |
239 } | 239 } |
240 m_webView->client()->setKeyboardFocusURL(focusURL); | 240 m_webView->client()->setKeyboardFocusURL(focusURL); |
241 } | 241 } |
242 | 242 |
243 void ChromeClientImpl::focusedFrameChanged(Frame*) | |
244 { | |
245 } | |
246 | |
247 Page* ChromeClientImpl::createWindow( | 243 Page* ChromeClientImpl::createWindow( |
248 Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features, con
st NavigationAction& action) | 244 Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features, con
st NavigationAction& action) |
249 { | 245 { |
250 if (!m_webView->client()) | 246 if (!m_webView->client()) |
251 return 0; | 247 return 0; |
252 | 248 |
253 // FrameLoaderClientImpl may have given us a policy to use for the next new | 249 // FrameLoaderClientImpl may have given us a policy to use for the next new |
254 // window navigation. If not, determine the policy using the same logic as | 250 // window navigation. If not, determine the policy using the same logic as |
255 // show(). | 251 // show(). |
256 WebNavigationPolicy policy; | 252 WebNavigationPolicy policy; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 } | 468 } |
473 return false; | 469 return false; |
474 } | 470 } |
475 | 471 |
476 void ChromeClientImpl::setStatusbarText(const String& message) | 472 void ChromeClientImpl::setStatusbarText(const String& message) |
477 { | 473 { |
478 if (m_webView->client()) | 474 if (m_webView->client()) |
479 m_webView->client()->setStatusText(message); | 475 m_webView->client()->setStatusText(message); |
480 } | 476 } |
481 | 477 |
482 bool ChromeClientImpl::shouldInterruptJavaScript() | |
483 { | |
484 // FIXME: implement me | |
485 return false; | |
486 } | |
487 | |
488 KeyboardUIMode ChromeClientImpl::keyboardUIMode() | 478 KeyboardUIMode ChromeClientImpl::keyboardUIMode() |
489 { | 479 { |
490 return m_webView->tabsToLinks() ? KeyboardAccessTabsToLinks : KeyboardAccess
Default; | 480 return m_webView->tabsToLinks() ? KeyboardAccessTabsToLinks : KeyboardAccess
Default; |
491 } | 481 } |
492 | 482 |
493 IntRect ChromeClientImpl::windowResizerRect() const | 483 IntRect ChromeClientImpl::windowResizerRect() const |
494 { | 484 { |
495 IntRect result; | 485 IntRect result; |
496 if (m_webView->client()) | 486 if (m_webView->client()) |
497 result = m_webView->client()->windowResizerRect(); | 487 result = m_webView->client()->windowResizerRect(); |
498 return result; | 488 return result; |
499 } | 489 } |
500 | 490 |
501 void ChromeClientImpl::invalidateRootView(const IntRect&) | |
502 { | |
503 notImplemented(); | |
504 } | |
505 | |
506 void ChromeClientImpl::invalidateContentsAndRootView(const IntRect& updateRect) | 491 void ChromeClientImpl::invalidateContentsAndRootView(const IntRect& updateRect) |
507 { | 492 { |
508 if (updateRect.isEmpty()) | 493 if (updateRect.isEmpty()) |
509 return; | 494 return; |
510 m_webView->invalidateRect(updateRect); | 495 m_webView->invalidateRect(updateRect); |
511 } | 496 } |
512 | 497 |
513 void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect
) | 498 void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect
) |
514 { | 499 { |
515 invalidateContentsAndRootView(updateRect); | 500 invalidateContentsAndRootView(updateRect); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 m_webView->setDeviceScaleFactor(deviceScaleFactor); | 681 m_webView->setDeviceScaleFactor(deviceScaleFactor); |
697 m_webView->setPageScaleFactorLimits(computed.minimumScale, computed.maximumS
cale); | 682 m_webView->setPageScaleFactorLimits(computed.minimumScale, computed.maximumS
cale); |
698 } | 683 } |
699 | 684 |
700 void ChromeClientImpl::print(Frame* frame) | 685 void ChromeClientImpl::print(Frame* frame) |
701 { | 686 { |
702 if (m_webView->client()) | 687 if (m_webView->client()) |
703 m_webView->client()->printPage(WebFrameImpl::fromFrame(frame)); | 688 m_webView->client()->printPage(WebFrameImpl::fromFrame(frame)); |
704 } | 689 } |
705 | 690 |
706 void ChromeClientImpl::exceededDatabaseQuota(Frame* frame, const String& databas
eName, DatabaseDetails) | |
707 { | |
708 // Chromium users cannot currently change the default quota | |
709 } | |
710 | |
711 void ChromeClientImpl::reachedMaxAppCacheSize(int64_t spaceNeeded) | |
712 { | |
713 ASSERT_NOT_REACHED(); | |
714 } | |
715 | |
716 void ChromeClientImpl::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64
_t) | |
717 { | |
718 ASSERT_NOT_REACHED(); | |
719 } | |
720 | |
721 #if ENABLE(INPUT_TYPE_COLOR) | 691 #if ENABLE(INPUT_TYPE_COLOR) |
722 PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient
* chooserClient, const Color&) | 692 PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient
* chooserClient, const Color&) |
723 { | 693 { |
724 OwnPtr<ColorChooserUIController> controller; | 694 OwnPtr<ColorChooserUIController> controller; |
725 #if ENABLE(PAGE_POPUP) | 695 #if ENABLE(PAGE_POPUP) |
726 controller = adoptPtr(new ColorChooserPopupUIController(this, chooserClient)
); | 696 controller = adoptPtr(new ColorChooserPopupUIController(this, chooserClient)
); |
727 #else | 697 #else |
728 controller = adoptPtr(new ColorChooserUIController(this, chooserClient)); | 698 controller = adoptPtr(new ColorChooserUIController(this, chooserClient)); |
729 #endif | 699 #endif |
730 controller->openUI(); | 700 controller->openUI(); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 if (settings->acceleratedCompositingForAnimationEnabled()) | 952 if (settings->acceleratedCompositingForAnimationEnabled()) |
983 flags |= AnimationTrigger; | 953 flags |= AnimationTrigger; |
984 if (settings->acceleratedCompositingForCanvasEnabled()) | 954 if (settings->acceleratedCompositingForCanvasEnabled()) |
985 flags |= CanvasTrigger; | 955 flags |= CanvasTrigger; |
986 if (settings->acceleratedCompositingForScrollableFramesEnabled()) | 956 if (settings->acceleratedCompositingForScrollableFramesEnabled()) |
987 flags |= ScrollableInnerFrameTrigger; | 957 flags |= ScrollableInnerFrameTrigger; |
988 | 958 |
989 return flags; | 959 return flags; |
990 } | 960 } |
991 | 961 |
992 bool ChromeClientImpl::supportsFullscreenForNode(const Node* node) | |
993 { | |
994 return false; | |
995 } | |
996 | |
997 void ChromeClientImpl::enterFullscreenForNode(Node* node) | 962 void ChromeClientImpl::enterFullscreenForNode(Node* node) |
998 { | 963 { |
999 ASSERT_NOT_REACHED(); | 964 ASSERT_NOT_REACHED(); |
1000 } | 965 } |
1001 | 966 |
1002 void ChromeClientImpl::exitFullscreenForNode(Node* node) | 967 void ChromeClientImpl::exitFullscreenForNode(Node* node) |
1003 { | 968 { |
1004 ASSERT_NOT_REACHED(); | 969 ASSERT_NOT_REACHED(); |
1005 } | 970 } |
1006 | 971 |
1007 bool ChromeClientImpl::supportsFullScreenForElement(const Element* element, bool
withKeyboard) | |
1008 { | |
1009 return true; | |
1010 } | |
1011 | |
1012 void ChromeClientImpl::enterFullScreenForElement(Element* element) | 972 void ChromeClientImpl::enterFullScreenForElement(Element* element) |
1013 { | 973 { |
1014 m_webView->enterFullScreenForElement(element); | 974 m_webView->enterFullScreenForElement(element); |
1015 } | 975 } |
1016 | 976 |
1017 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 977 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
1018 { | 978 { |
1019 m_webView->exitFullScreenForElement(element); | 979 m_webView->exitFullScreenForElement(element); |
1020 } | 980 } |
1021 | 981 |
1022 void ChromeClientImpl::fullScreenRendererChanged(RenderBox*) | |
1023 { | |
1024 notImplemented(); | |
1025 } | |
1026 | |
1027 bool ChromeClientImpl::selectItemWritingDirectionIsNatural() | |
1028 { | |
1029 return false; | |
1030 } | |
1031 | |
1032 bool ChromeClientImpl::selectItemAlignmentFollowsMenuWritingDirection() | |
1033 { | |
1034 return true; | |
1035 } | |
1036 | |
1037 bool ChromeClientImpl::hasOpenedPopup() const | 982 bool ChromeClientImpl::hasOpenedPopup() const |
1038 { | 983 { |
1039 return m_webView->hasOpenedPopup(); | 984 return m_webView->hasOpenedPopup(); |
1040 } | 985 } |
1041 | 986 |
1042 PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client)
const | 987 PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client)
const |
1043 { | 988 { |
1044 if (WebViewImpl::useExternalPopupMenus()) | 989 if (WebViewImpl::useExternalPopupMenus()) |
1045 return adoptRef(new ExternalPopupMenu(client, m_webView->client())); | 990 return adoptRef(new ExternalPopupMenu(client, m_webView->client())); |
1046 | 991 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 | 1076 |
1132 ASSERT_NOT_REACHED(); | 1077 ASSERT_NOT_REACHED(); |
1133 return true; | 1078 return true; |
1134 } | 1079 } |
1135 | 1080 |
1136 void ChromeClientImpl::numWheelEventHandlersChanged(unsigned numberOfWheelHandle
rs) | 1081 void ChromeClientImpl::numWheelEventHandlersChanged(unsigned numberOfWheelHandle
rs) |
1137 { | 1082 { |
1138 m_webView->numberOfWheelEventHandlersChanged(numberOfWheelHandlers); | 1083 m_webView->numberOfWheelEventHandlersChanged(numberOfWheelHandlers); |
1139 } | 1084 } |
1140 | 1085 |
1141 bool ChromeClientImpl::shouldAutoscrollForDragAndDrop(WebCore::RenderBox*) const | |
1142 { | |
1143 return true; | |
1144 } | |
1145 | |
1146 | |
1147 void ChromeClientImpl::needTouchEvents(bool needsTouchEvents) | 1086 void ChromeClientImpl::needTouchEvents(bool needsTouchEvents) |
1148 { | 1087 { |
1149 m_webView->hasTouchEventHandlers(needsTouchEvents); | 1088 m_webView->hasTouchEventHandlers(needsTouchEvents); |
1150 } | 1089 } |
1151 | 1090 |
1152 bool ChromeClientImpl::requestPointerLock() | 1091 bool ChromeClientImpl::requestPointerLock() |
1153 { | 1092 { |
1154 return m_webView->requestPointerLock(); | 1093 return m_webView->requestPointerLock(); |
1155 } | 1094 } |
1156 | 1095 |
(...skipping 18 matching lines...) Expand all Loading... |
1175 { | 1114 { |
1176 if (!m_webView->autofillClient()) | 1115 if (!m_webView->autofillClient()) |
1177 return; | 1116 return; |
1178 WebVector<WebNode> elementVector(static_cast<size_t>(elements.size())); | 1117 WebVector<WebNode> elementVector(static_cast<size_t>(elements.size())); |
1179 size_t elementsCount = elements.size(); | 1118 size_t elementsCount = elements.size(); |
1180 for (size_t i = 0; i < elementsCount; ++i) | 1119 for (size_t i = 0; i < elementsCount; ++i) |
1181 elementVector[i] = elements[i]; | 1120 elementVector[i] = elements[i]; |
1182 m_webView->autofillClient()->didAssociateFormControls(elementVector); | 1121 m_webView->autofillClient()->didAssociateFormControls(elementVector); |
1183 } | 1122 } |
1184 | 1123 |
1185 bool ChromeClientImpl::shouldNotifyOnFormChanges() | |
1186 { | |
1187 return true; | |
1188 } | |
1189 | |
1190 #if ENABLE(NAVIGATOR_CONTENT_UTILS) | 1124 #if ENABLE(NAVIGATOR_CONTENT_UTILS) |
1191 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::cre
ate(WebViewImpl* webView) | 1125 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::cre
ate(WebViewImpl* webView) |
1192 { | 1126 { |
1193 return adoptPtr(new NavigatorContentUtilsClientImpl(webView)); | 1127 return adoptPtr(new NavigatorContentUtilsClientImpl(webView)); |
1194 } | 1128 } |
1195 | 1129 |
1196 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* we
bView) | 1130 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* we
bView) |
1197 : m_webView(webView) | 1131 : m_webView(webView) |
1198 { | 1132 { |
1199 } | 1133 } |
1200 | 1134 |
1201 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche
me, const String& baseURL, const String& url, const String& title) | 1135 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche
me, const String& baseURL, const String& url, const String& title) |
1202 { | 1136 { |
1203 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); | 1137 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); |
1204 } | 1138 } |
1205 #endif | 1139 #endif |
1206 | 1140 |
1207 } // namespace WebKit | 1141 } // namespace WebKit |
OLD | NEW |