OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 m_popupClient->ownerElement().document().existingAXObjectCache()) | 319 m_popupClient->ownerElement().document().existingAXObjectCache()) |
320 cache->childrenChanged(&m_popupClient->ownerElement()); | 320 cache->childrenChanged(&m_popupClient->ownerElement()); |
321 | 321 |
322 DCHECK(frame->domWindow()); | 322 DCHECK(frame->domWindow()); |
323 PagePopupSupplement::install(*frame, *this, m_popupClient); | 323 PagePopupSupplement::install(*frame, *this, m_popupClient); |
324 DCHECK_EQ(m_popupClient->ownerElement().document().existingAXObjectCache(), | 324 DCHECK_EQ(m_popupClient->ownerElement().document().existingAXObjectCache(), |
325 frame->document()->existingAXObjectCache()); | 325 frame->document()->existingAXObjectCache()); |
326 | 326 |
327 RefPtr<SharedBuffer> data = SharedBuffer::create(); | 327 RefPtr<SharedBuffer> data = SharedBuffer::create(); |
328 m_popupClient->writeDocument(data.get()); | 328 m_popupClient->writeDocument(data.get()); |
| 329 frame->setPageZoomFactor(m_popupClient->zoomFactor()); |
329 frame->loader().load(FrameLoadRequest( | 330 frame->loader().load(FrameLoadRequest( |
330 0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), | 331 0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), |
331 ForceSynchronousLoad))); | 332 ForceSynchronousLoad))); |
332 frame->setPageZoomFactor(m_popupClient->zoomFactor()); | |
333 return true; | 333 return true; |
334 } | 334 } |
335 | 335 |
336 void WebPagePopupImpl::postMessage(const String& message) { | 336 void WebPagePopupImpl::postMessage(const String& message) { |
337 if (!m_page) | 337 if (!m_page) |
338 return; | 338 return; |
339 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 339 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
340 if (LocalDOMWindow* window = toLocalFrame(m_page->mainFrame())->domWindow()) | 340 if (LocalDOMWindow* window = toLocalFrame(m_page->mainFrame())->domWindow()) |
341 window->dispatchEvent(MessageEvent::create(message)); | 341 window->dispatchEvent(MessageEvent::create(message)); |
342 } | 342 } |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // A WebPagePopupImpl instance usually has two references. | 600 // A WebPagePopupImpl instance usually has two references. |
601 // - One owned by the instance itself. It represents the visible widget. | 601 // - One owned by the instance itself. It represents the visible widget. |
602 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 602 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
603 // WebPagePopupImpl to close. | 603 // WebPagePopupImpl to close. |
604 // We need them because the closing operation is asynchronous and the widget | 604 // We need them because the closing operation is asynchronous and the widget |
605 // can be closed while the WebViewImpl is unaware of it. | 605 // can be closed while the WebViewImpl is unaware of it. |
606 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 606 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
607 } | 607 } |
608 | 608 |
609 } // namespace blink | 609 } // namespace blink |
OLD | NEW |