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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "core/html/forms/ColorChooserClient.h" | 50 #include "core/html/forms/ColorChooserClient.h" |
51 #include "core/html/forms/DateTimeChooser.h" | 51 #include "core/html/forms/DateTimeChooser.h" |
52 #include "core/loader/DocumentLoader.h" | 52 #include "core/loader/DocumentLoader.h" |
53 #include "core/loader/FrameLoadRequest.h" | 53 #include "core/loader/FrameLoadRequest.h" |
54 #include "core/page/Page.h" | 54 #include "core/page/Page.h" |
55 #include "core/page/PagePopupDriver.h" | 55 #include "core/page/PagePopupDriver.h" |
56 #include "core/page/WindowFeatures.h" | 56 #include "core/page/WindowFeatures.h" |
57 #include "core/rendering/HitTestResult.h" | 57 #include "core/rendering/HitTestResult.h" |
58 #include "core/rendering/RenderPart.h" | 58 #include "core/rendering/RenderPart.h" |
59 #include "core/rendering/RenderWidget.h" | 59 #include "core/rendering/RenderWidget.h" |
| 60 #include "core/rendering/compositing/CompositedSelectionBound.h" |
60 #include "platform/Cursor.h" | 61 #include "platform/Cursor.h" |
61 #include "platform/FileChooser.h" | 62 #include "platform/FileChooser.h" |
62 #include "platform/NotImplemented.h" | 63 #include "platform/NotImplemented.h" |
63 #include "platform/PlatformScreen.h" | 64 #include "platform/PlatformScreen.h" |
64 #include "platform/RuntimeEnabledFeatures.h" | 65 #include "platform/RuntimeEnabledFeatures.h" |
65 #include "platform/exported/WrappedResourceRequest.h" | 66 #include "platform/exported/WrappedResourceRequest.h" |
66 #include "platform/geometry/FloatRect.h" | 67 #include "platform/geometry/FloatRect.h" |
67 #include "platform/geometry/IntRect.h" | 68 #include "platform/geometry/IntRect.h" |
68 #include "platform/graphics/GraphicsLayer.h" | 69 #include "platform/graphics/GraphicsLayer.h" |
69 #include "platform/weborigin/SecurityOrigin.h" | 70 #include "platform/weborigin/SecurityOrigin.h" |
70 #include "public/platform/Platform.h" | 71 #include "public/platform/Platform.h" |
71 #include "public/platform/WebCursorInfo.h" | 72 #include "public/platform/WebCursorInfo.h" |
72 #include "public/platform/WebRect.h" | 73 #include "public/platform/WebRect.h" |
| 74 #include "public/platform/WebSelectionBound.h" |
73 #include "public/platform/WebURLRequest.h" | 75 #include "public/platform/WebURLRequest.h" |
74 #include "public/web/WebAXObject.h" | 76 #include "public/web/WebAXObject.h" |
75 #include "public/web/WebAutofillClient.h" | 77 #include "public/web/WebAutofillClient.h" |
76 #include "public/web/WebColorChooser.h" | 78 #include "public/web/WebColorChooser.h" |
77 #include "public/web/WebColorSuggestion.h" | 79 #include "public/web/WebColorSuggestion.h" |
78 #include "public/web/WebConsoleMessage.h" | 80 #include "public/web/WebConsoleMessage.h" |
79 #include "public/web/WebFrameClient.h" | 81 #include "public/web/WebFrameClient.h" |
80 #include "public/web/WebInputElement.h" | 82 #include "public/web/WebInputElement.h" |
81 #include "public/web/WebInputEvent.h" | 83 #include "public/web/WebInputEvent.h" |
82 #include "public/web/WebKit.h" | 84 #include "public/web/WebKit.h" |
(...skipping 27 matching lines...) Expand all Loading... |
110 | 112 |
111 namespace blink { | 113 namespace blink { |
112 | 114 |
113 // Converts a AXObjectCache::AXNotification to a WebAXEvent | 115 // Converts a AXObjectCache::AXNotification to a WebAXEvent |
114 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) | 116 static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) |
115 { | 117 { |
116 // These enums have the same values; enforced in AssertMatchingEnums.cpp. | 118 // These enums have the same values; enforced in AssertMatchingEnums.cpp. |
117 return static_cast<WebAXEvent>(notification); | 119 return static_cast<WebAXEvent>(notification); |
118 } | 120 } |
119 | 121 |
| 122 static WebSelectionBound toWebSelectionBound(const CompositedSelectionBound& bou
nd) |
| 123 { |
| 124 ASSERT(bound.layer); |
| 125 |
| 126 // These enums have the same values; enforced in AssertMatchingEnums.cpp. |
| 127 WebSelectionBound result(static_cast<WebSelectionBound::Type>(bound.type)); |
| 128 result.layerId = bound.layer->platformLayer()->id(); |
| 129 result.edgeTopInLayer = roundedIntPoint(bound.edgeTopInLayer); |
| 130 result.edgeBottomInLayer = roundedIntPoint(bound.edgeBottomInLayer); |
| 131 return result; |
| 132 } |
| 133 |
120 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) | 134 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) |
121 : m_webView(webView) | 135 : m_webView(webView) |
122 , m_toolbarsVisible(true) | 136 , m_toolbarsVisible(true) |
123 , m_statusbarVisible(true) | 137 , m_statusbarVisible(true) |
124 , m_scrollbarsVisible(true) | 138 , m_scrollbarsVisible(true) |
125 , m_menubarVisible(true) | 139 , m_menubarVisible(true) |
126 , m_resizable(true) | 140 , m_resizable(true) |
127 , m_pagePopupDriver(webView) | 141 , m_pagePopupDriver(webView) |
128 { | 142 { |
129 } | 143 } |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 void ChromeClientImpl::exitFullScreenForElement(Element* element) | 709 void ChromeClientImpl::exitFullScreenForElement(Element* element) |
696 { | 710 { |
697 m_webView->exitFullScreenForElement(element); | 711 m_webView->exitFullScreenForElement(element); |
698 } | 712 } |
699 | 713 |
700 void ChromeClientImpl::clearCompositedSelectionBounds() | 714 void ChromeClientImpl::clearCompositedSelectionBounds() |
701 { | 715 { |
702 m_webView->clearCompositedSelectionBounds(); | 716 m_webView->clearCompositedSelectionBounds(); |
703 } | 717 } |
704 | 718 |
| 719 void ChromeClientImpl::updateCompositedSelectionBounds(const CompositedSelection
Bound& anchor, const CompositedSelectionBound& focus) |
| 720 { |
| 721 m_webView->updateCompositedSelectionBounds(toWebSelectionBound(anchor), toWe
bSelectionBound(focus)); |
| 722 } |
| 723 |
705 bool ChromeClientImpl::hasOpenedPopup() const | 724 bool ChromeClientImpl::hasOpenedPopup() const |
706 { | 725 { |
707 return m_webView->hasOpenedPopup(); | 726 return m_webView->hasOpenedPopup(); |
708 } | 727 } |
709 | 728 |
710 PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(LocalFrame& frame, Popup
MenuClient* client) const | 729 PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(LocalFrame& frame, Popup
MenuClient* client) const |
711 { | 730 { |
712 if (WebViewImpl::useExternalPopupMenus()) | 731 if (WebViewImpl::useExternalPopupMenus()) |
713 return adoptRef(new ExternalPopupMenu(frame, client, *m_webView)); | 732 return adoptRef(new ExternalPopupMenu(frame, client, *m_webView)); |
714 | 733 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp
utElement)); | 888 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp
utElement)); |
870 } | 889 } |
871 | 890 |
872 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) | 891 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) |
873 { | 892 { |
874 if (m_webView->autofillClient()) | 893 if (m_webView->autofillClient()) |
875 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); | 894 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); |
876 } | 895 } |
877 | 896 |
878 } // namespace blink | 897 } // namespace blink |
OLD | NEW |