| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 { | 211 { |
| 212 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); | 212 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); |
| 213 if (webframe && webframe->client()) | 213 if (webframe && webframe->client()) |
| 214 webframe->client()->frameFocused(); | 214 webframe->client()->frameFocused(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 Page* ChromeClientImpl::createWindow(LocalFrame* frame, const FrameLoadRequest&
r, const WindowFeatures& features, | 217 Page* ChromeClientImpl::createWindow(LocalFrame* frame, const FrameLoadRequest&
r, const WindowFeatures& features, |
| 218 NavigationPolicy navigationPolicy, ShouldSendReferrer shouldSendReferrer) | 218 NavigationPolicy navigationPolicy, ShouldSendReferrer shouldSendReferrer) |
| 219 { | 219 { |
| 220 if (!m_webView->client()) | 220 if (!m_webView->client()) |
| 221 return 0; | 221 return nullptr; |
| 222 | 222 |
| 223 WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPoli
cy); | 223 WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPoli
cy); |
| 224 if (policy == WebNavigationPolicyIgnore) | 224 if (policy == WebNavigationPolicyIgnore) |
| 225 policy = getNavigationPolicy(features); | 225 policy = getNavigationPolicy(features); |
| 226 else if (policy == WebNavigationPolicyNewBackgroundTab && getNavigationPolic
y(m_windowFeatures) != WebNavigationPolicyNewBackgroundTab) | 226 else if (policy == WebNavigationPolicyNewBackgroundTab && getNavigationPolic
y(m_windowFeatures) != WebNavigationPolicyNewBackgroundTab) |
| 227 policy = WebNavigationPolicyNewForegroundTab; | 227 policy = WebNavigationPolicyNewForegroundTab; |
| 228 | 228 |
| 229 ASSERT(frame->document()); | 229 ASSERT(frame->document()); |
| 230 Fullscreen::fullyExitFullscreen(*frame->document()); | 230 Fullscreen::fullyExitFullscreen(*frame->document()); |
| 231 | 231 |
| 232 WebViewImpl* newView = toWebViewImpl( | 232 WebViewImpl* newView = toWebViewImpl( |
| 233 m_webView->client()->createView(WebLocalFrameImpl::fromFrame(frame), Wra
ppedResourceRequest(r.resourceRequest()), features, r.frameName(), policy, shoul
dSendReferrer == NeverSendReferrer)); | 233 m_webView->client()->createView(WebLocalFrameImpl::fromFrame(frame), Wra
ppedResourceRequest(r.resourceRequest()), features, r.frameName(), policy, shoul
dSendReferrer == NeverSendReferrer)); |
| 234 if (!newView) | 234 if (!newView) |
| 235 return 0; | 235 return nullptr; |
| 236 return newView->page(); | 236 return newView->page(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 static inline void updatePolicyForEvent(const WebInputEvent* inputEvent, Navigat
ionPolicy* policy) | 239 static inline void updatePolicyForEvent(const WebInputEvent* inputEvent, Navigat
ionPolicy* policy) |
| 240 { | 240 { |
| 241 if (!inputEvent || inputEvent->type != WebInputEvent::MouseUp) | 241 if (!inputEvent || inputEvent->type != WebInputEvent::MouseUp) |
| 242 return; | 242 return; |
| 243 | 243 |
| 244 const WebMouseEvent* mouseEvent = static_cast<const WebMouseEvent*>(inputEve
nt); | 244 const WebMouseEvent* mouseEvent = static_cast<const WebMouseEvent*>(inputEve
nt); |
| 245 | 245 |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 return m_webView->shouldDisableDesktopWorkarounds(); | 813 return m_webView->shouldDisableDesktopWorkarounds(); |
| 814 } | 814 } |
| 815 | 815 |
| 816 void ChromeClientImpl::annotatedRegionsChanged() | 816 void ChromeClientImpl::annotatedRegionsChanged() |
| 817 { | 817 { |
| 818 WebViewClient* client = m_webView->client(); | 818 WebViewClient* client = m_webView->client(); |
| 819 if (client) | 819 if (client) |
| 820 client->draggableRegionsChanged(); | 820 client->draggableRegionsChanged(); |
| 821 } | 821 } |
| 822 | 822 |
| 823 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil
lBeMember<Element> >& elements, LocalFrame* frame) | 823 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil
lBeMember<Element>>& elements, LocalFrame* frame) |
| 824 { | 824 { |
| 825 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); | 825 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); |
| 826 if (webframe->autofillClient()) | 826 if (webframe->autofillClient()) |
| 827 webframe->autofillClient()->didAssociateFormControls(elements); | 827 webframe->autofillClient()->didAssociateFormControls(elements); |
| 828 } | 828 } |
| 829 | 829 |
| 830 void ChromeClientImpl::didCancelCompositionOnSelectionChange() | 830 void ChromeClientImpl::didCancelCompositionOnSelectionChange() |
| 831 { | 831 { |
| 832 if (m_webView->client()) | 832 if (m_webView->client()) |
| 833 m_webView->client()->didCancelCompositionOnSelectionChange(); | 833 m_webView->client()->didCancelCompositionOnSelectionChange(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu
t)); | 886 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu
t)); |
| 887 } | 887 } |
| 888 | 888 |
| 889 void ChromeClientImpl::registerViewportLayers() const | 889 void ChromeClientImpl::registerViewportLayers() const |
| 890 { | 890 { |
| 891 if (m_webView->rootGraphicsLayer() && m_webView->layerTreeView() && m_webVie
w->pinchVirtualViewportEnabled()) | 891 if (m_webView->rootGraphicsLayer() && m_webView->layerTreeView() && m_webVie
w->pinchVirtualViewportEnabled()) |
| 892 m_webView->page()->frameHost().pinchViewport().registerLayersWithTreeVie
w(m_webView->layerTreeView()); | 892 m_webView->page()->frameHost().pinchViewport().registerLayersWithTreeVie
w(m_webView->layerTreeView()); |
| 893 } | 893 } |
| 894 | 894 |
| 895 } // namespace blink | 895 } // namespace blink |
| OLD | NEW |