| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "web/WebViewImpl.h" | 32 #include "web/WebViewImpl.h" |
| 33 | 33 |
| 34 #include "gen/sky/core/CSSValueKeywords.h" | |
| 35 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 36 #include "core/dom/DocumentMarkerController.h" | 35 #include "core/dom/DocumentMarkerController.h" |
| 37 #include "core/dom/NodeRenderingTraversal.h" | 36 #include "core/dom/NodeRenderingTraversal.h" |
| 38 #include "core/dom/Text.h" | 37 #include "core/dom/Text.h" |
| 39 #include "core/editing/Editor.h" | 38 #include "core/editing/Editor.h" |
| 40 #include "core/editing/FrameSelection.h" | 39 #include "core/editing/FrameSelection.h" |
| 41 #include "core/editing/HTMLInterchange.h" | 40 #include "core/editing/HTMLInterchange.h" |
| 42 #include "core/editing/InputMethodController.h" | 41 #include "core/editing/InputMethodController.h" |
| 43 #include "core/editing/markup.h" | 42 #include "core/editing/markup.h" |
| 44 #include "core/editing/TextIterator.h" | 43 #include "core/editing/TextIterator.h" |
| 45 #include "core/events/KeyboardEvent.h" | 44 #include "core/events/KeyboardEvent.h" |
| 46 #include "core/events/WheelEvent.h" | 45 #include "core/events/WheelEvent.h" |
| 47 #include "core/frame/FrameHost.h" | 46 #include "core/frame/FrameHost.h" |
| 48 #include "core/frame/FrameView.h" | 47 #include "core/frame/FrameView.h" |
| 49 #include "core/frame/LocalFrame.h" | 48 #include "core/frame/LocalFrame.h" |
| 50 #include "core/frame/Settings.h" | 49 #include "core/frame/Settings.h" |
| 51 #include "core/html/HTMLImportElement.h" | 50 #include "core/html/HTMLImportElement.h" |
| 52 #include "core/html/ime/InputMethodContext.h" | 51 #include "core/html/ime/InputMethodContext.h" |
| 53 #include "gen/sky/core/HTMLNames.h" | |
| 54 #include "v8_inspector/inspector_backend_mojo.h" | |
| 55 #include "core/loader/FrameLoader.h" | 52 #include "core/loader/FrameLoader.h" |
| 56 #include "core/loader/UniqueIdentifier.h" | 53 #include "core/loader/UniqueIdentifier.h" |
| 57 #include "core/page/Chrome.h" | 54 #include "core/page/Chrome.h" |
| 58 #include "core/page/EventHandler.h" | 55 #include "core/page/EventHandler.h" |
| 59 #include "core/page/EventWithHitTestResults.h" | 56 #include "core/page/EventWithHitTestResults.h" |
| 60 #include "core/page/FocusController.h" | 57 #include "core/page/FocusController.h" |
| 61 #include "core/page/Page.h" | 58 #include "core/page/Page.h" |
| 62 #include "core/page/TouchDisambiguation.h" | 59 #include "core/page/TouchDisambiguation.h" |
| 63 #include "core/rendering/compositing/RenderLayerCompositor.h" | 60 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 64 #include "core/rendering/RenderView.h" | 61 #include "core/rendering/RenderView.h" |
| 62 #include "gen/sky/core/CSSValueKeywords.h" |
| 63 #include "gen/sky/core/HTMLNames.h" |
| 64 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 65 #include "platform/Cursor.h" | 65 #include "platform/Cursor.h" |
| 66 #include "platform/exported/WebActiveGestureAnimation.h" | 66 #include "platform/exported/WebActiveGestureAnimation.h" |
| 67 #include "platform/fonts/FontCache.h" | 67 #include "platform/fonts/FontCache.h" |
| 68 #include "platform/graphics/Color.h" | 68 #include "platform/graphics/Color.h" |
| 69 #include "platform/graphics/Image.h" | 69 #include "platform/graphics/Image.h" |
| 70 #include "platform/graphics/ImageBuffer.h" | 70 #include "platform/graphics/ImageBuffer.h" |
| 71 #include "platform/KeyboardCodes.h" | 71 #include "platform/KeyboardCodes.h" |
| 72 #include "platform/Logging.h" | 72 #include "platform/Logging.h" |
| 73 #include "platform/NotImplemented.h" | 73 #include "platform/NotImplemented.h" |
| 74 #include "platform/PlatformGestureEvent.h" | 74 #include "platform/PlatformGestureEvent.h" |
| 75 #include "platform/PlatformKeyboardEvent.h" | 75 #include "platform/PlatformKeyboardEvent.h" |
| 76 #include "platform/PlatformMouseEvent.h" | 76 #include "platform/PlatformMouseEvent.h" |
| 77 #include "platform/PlatformWheelEvent.h" | 77 #include "platform/PlatformWheelEvent.h" |
| 78 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | |
| 79 #include "platform/scroll/Scrollbar.h" | 78 #include "platform/scroll/Scrollbar.h" |
| 80 #include "platform/TraceEvent.h" | 79 #include "platform/TraceEvent.h" |
| 81 #include "platform/UserGestureIndicator.h" | 80 #include "platform/UserGestureIndicator.h" |
| 82 #include "platform/weborigin/SchemeRegistry.h" | 81 #include "platform/weborigin/SchemeRegistry.h" |
| 83 #include "public/platform/Platform.h" | 82 #include "public/platform/Platform.h" |
| 84 #include "public/platform/WebFloatPoint.h" | 83 #include "public/platform/WebFloatPoint.h" |
| 85 #include "public/platform/WebGestureCurve.h" | 84 #include "public/platform/WebGestureCurve.h" |
| 86 #include "public/platform/WebImage.h" | 85 #include "public/platform/WebImage.h" |
| 87 #include "public/platform/WebLayerTreeView.h" | 86 #include "public/platform/WebLayerTreeView.h" |
| 88 #include "public/platform/WebURLRequest.h" | 87 #include "public/platform/WebURLRequest.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 , m_baseBackgroundColor(Color::white) | 170 , m_baseBackgroundColor(Color::white) |
| 172 , m_backgroundColorOverride(Color::transparent) | 171 , m_backgroundColorOverride(Color::transparent) |
| 173 , m_userGestureObserved(false) | 172 , m_userGestureObserved(false) |
| 174 { | 173 { |
| 175 Page::PageClients pageClients; | 174 Page::PageClients pageClients; |
| 176 pageClients.chromeClient = &m_chromeClientImpl; | 175 pageClients.chromeClient = &m_chromeClientImpl; |
| 177 pageClients.editorClient = &m_editorClientImpl; | 176 pageClients.editorClient = &m_editorClientImpl; |
| 178 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 177 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
| 179 | 178 |
| 180 m_page = adoptPtr(new Page(pageClients, m_client->services())); | 179 m_page = adoptPtr(new Page(pageClients, m_client->services())); |
| 181 m_page->makeOrdinary(); | |
| 182 | 180 |
| 183 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); | 181 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); |
| 184 setVisibilityState(m_client->visibilityState(), true); | 182 setVisibilityState(m_client->visibilityState(), true); |
| 185 | 183 |
| 186 m_layerTreeView = m_client->initializeLayerTreeView(); | 184 m_layerTreeView = m_client->initializeLayerTreeView(); |
| 187 | 185 |
| 188 #if !ENABLE(COMPOSITOR) | 186 #if !ENABLE(COMPOSITOR) |
| 189 m_layerTreeView = nullptr; | 187 m_layerTreeView = nullptr; |
| 190 #endif | 188 #endif |
| 191 } | 189 } |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 void WebViewImpl::injectModule(const WebString& path) | 1601 void WebViewImpl::injectModule(const WebString& path) |
| 1604 { | 1602 { |
| 1605 RefPtr<Document> document = m_page->mainFrame()->document(); | 1603 RefPtr<Document> document = m_page->mainFrame()->document(); |
| 1606 RefPtr<HTMLImportElement> import = HTMLImportElement::create(*document); | 1604 RefPtr<HTMLImportElement> import = HTMLImportElement::create(*document); |
| 1607 import->setAttribute(HTMLNames::srcAttr, path); | 1605 import->setAttribute(HTMLNames::srcAttr, path); |
| 1608 if (!document->documentElement()) | 1606 if (!document->documentElement()) |
| 1609 return; | 1607 return; |
| 1610 document->documentElement()->appendChild(import.release()); | 1608 document->documentElement()->appendChild(import.release()); |
| 1611 } | 1609 } |
| 1612 | 1610 |
| 1613 void WebViewImpl::connectInspectorBackend() | |
| 1614 { | |
| 1615 m_inspectorBackend = adoptPtr(new InspectorBackendMojo(page()->frameHost()))
; | |
| 1616 m_inspectorBackend->Connect(); | |
| 1617 } | |
| 1618 | |
| 1619 void WebViewImpl::setFocusedFrame(WebFrame* frame) | 1611 void WebViewImpl::setFocusedFrame(WebFrame* frame) |
| 1620 { | 1612 { |
| 1621 if (!frame) { | 1613 if (!frame) { |
| 1622 // Clears the focused frame if any. | 1614 // Clears the focused frame if any. |
| 1623 LocalFrame* focusedFrame = focusedCoreFrame(); | 1615 LocalFrame* focusedFrame = focusedCoreFrame(); |
| 1624 if (focusedFrame) | 1616 if (focusedFrame) |
| 1625 focusedFrame->selection().setFocused(false); | 1617 focusedFrame->selection().setFocused(false); |
| 1626 return; | 1618 return; |
| 1627 } | 1619 } |
| 1628 LocalFrame* coreFrame = toWebLocalFrameImpl(frame)->frame(); | 1620 LocalFrame* coreFrame = toWebLocalFrameImpl(frame)->frame(); |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2263 m_layerTreeView->setVisible(visible); | 2255 m_layerTreeView->setVisible(visible); |
| 2264 } | 2256 } |
| 2265 } | 2257 } |
| 2266 | 2258 |
| 2267 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 2259 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 2268 { | 2260 { |
| 2269 return true; | 2261 return true; |
| 2270 } | 2262 } |
| 2271 | 2263 |
| 2272 } // namespace blink | 2264 } // namespace blink |
| OLD | NEW |