OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
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 19 matching lines...) Expand all Loading... | |
30 */ | 30 */ |
31 | 31 |
32 #include "config.h" | 32 #include "config.h" |
33 #include "web/FrameLoaderClientImpl.h" | 33 #include "web/FrameLoaderClientImpl.h" |
34 | 34 |
35 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
37 #include "core/events/MouseEvent.h" | 37 #include "core/events/MouseEvent.h" |
38 #include "core/frame/FrameView.h" | 38 #include "core/frame/FrameView.h" |
39 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
40 #include "core/html/HTMLViewElement.h" | |
40 #include "core/page/Chrome.h" | 41 #include "core/page/Chrome.h" |
41 #include "core/page/EventHandler.h" | 42 #include "core/page/EventHandler.h" |
42 #include "core/page/Page.h" | 43 #include "core/page/Page.h" |
43 #include "core/rendering/HitTestResult.h" | 44 #include "core/rendering/HitTestResult.h" |
44 #include "platform/MIMETypeRegistry.h" | 45 #include "platform/MIMETypeRegistry.h" |
45 #include "platform/RuntimeEnabledFeatures.h" | 46 #include "platform/RuntimeEnabledFeatures.h" |
46 #include "platform/UserGestureIndicator.h" | 47 #include "platform/UserGestureIndicator.h" |
47 #include "platform/exported/WrappedResourceRequest.h" | 48 #include "platform/exported/WrappedResourceRequest.h" |
48 #include "platform/exported/WrappedResourceResponse.h" | 49 #include "platform/exported/WrappedResourceResponse.h" |
49 #include "platform/network/HTTPParsers.h" | 50 #include "platform/network/HTTPParsers.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 void FrameLoaderClientImpl::loadURLExternally(const ResourceRequest& request, Na vigationPolicy policy, const String& suggestedName) | 244 void FrameLoaderClientImpl::loadURLExternally(const ResourceRequest& request, Na vigationPolicy policy, const String& suggestedName) |
244 { | 245 { |
245 if (m_webFrame->client()) { | 246 if (m_webFrame->client()) { |
246 ASSERT(m_webFrame->frame()->document()); | 247 ASSERT(m_webFrame->frame()->document()); |
247 WrappedResourceRequest webreq(request); | 248 WrappedResourceRequest webreq(request); |
248 m_webFrame->client()->loadURLExternally( | 249 m_webFrame->client()->loadURLExternally( |
249 m_webFrame, webreq, static_cast<WebNavigationPolicy>(policy), sugges tedName); | 250 m_webFrame, webreq, static_cast<WebNavigationPolicy>(policy), sugges tedName); |
250 } | 251 } |
251 } | 252 } |
252 | 253 |
254 void FrameLoaderClientImpl::createView(const KURL& url, HTMLViewElement* ownerEl ement) | |
255 { | |
256 if (m_webFrame->client()) { | |
257 WebRect bounds(ownerElement->offsetLeft(), | |
258 ownerElement->offsetTop(), | |
259 ownerElement->offsetWidth(), | |
260 ownerElement->offsetHeight()); | |
esprehn
2014/11/06 22:40:28
You want clientLeft etc. not offset, your size doe
abarth-chromium
2014/11/06 22:55:07
Don't we need to wait until layout happens before
Matt Perry
2014/11/06 23:38:50
Done.
| |
261 m_webFrame->client()->createChildView(url, bounds); | |
262 } | |
263 } | |
264 | |
253 void FrameLoaderClientImpl::selectorMatchChanged(const Vector<String>& addedSele ctors, const Vector<String>& removedSelectors) | 265 void FrameLoaderClientImpl::selectorMatchChanged(const Vector<String>& addedSele ctors, const Vector<String>& removedSelectors) |
254 { | 266 { |
255 if (WebFrameClient* client = m_webFrame->client()) | 267 if (WebFrameClient* client = m_webFrame->client()) |
256 client->didMatchCSS(m_webFrame, WebVector<WebString>(addedSelectors), We bVector<WebString>(removedSelectors)); | 268 client->didMatchCSS(m_webFrame, WebVector<WebString>(addedSelectors), We bVector<WebString>(removedSelectors)); |
257 } | 269 } |
258 | 270 |
259 // Called when the FrameLoader goes into a state in which a new page load | 271 // Called when the FrameLoader goes into a state in which a new page load |
260 // will occur. | 272 // will occur. |
261 void FrameLoaderClientImpl::transitionToCommittedForNewPage() | 273 void FrameLoaderClientImpl::transitionToCommittedForNewPage() |
262 { | 274 { |
263 m_webFrame->createFrameView(); | 275 m_webFrame->createFrameView(); |
264 } | 276 } |
265 | 277 |
266 void FrameLoaderClientImpl::didLoseWebGLContext(int arbRobustnessContextLostReas on) | 278 void FrameLoaderClientImpl::didLoseWebGLContext(int arbRobustnessContextLostReas on) |
267 { | 279 { |
268 if (m_webFrame->client()) | 280 if (m_webFrame->client()) |
269 m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessConte xtLostReason); | 281 m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessConte xtLostReason); |
270 } | 282 } |
271 | 283 |
272 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 284 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
273 { | 285 { |
274 if (m_webFrame->client()) | 286 if (m_webFrame->client()) |
275 m_webFrame->client()->didChangeManifest(m_webFrame); | 287 m_webFrame->client()->didChangeManifest(m_webFrame); |
276 } | 288 } |
277 | 289 |
278 } // namespace blink | 290 } // namespace blink |
OLD | NEW |