| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 , m_closeTimer(this, &MockPagePopup::close) | 61 , m_closeTimer(this, &MockPagePopup::close) |
| 62 { | 62 { |
| 63 Document* document = mainFrame->document(); | 63 Document* document = mainFrame->document(); |
| 64 m_iframe = HTMLIFrameElement::create(HTMLNames::iframeTag, document); | 64 m_iframe = HTMLIFrameElement::create(HTMLNames::iframeTag, document); |
| 65 m_iframe->setIdAttribute("mock-page-popup"); | 65 m_iframe->setIdAttribute("mock-page-popup"); |
| 66 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa
lue::CSS_PX); | 66 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa
lue::CSS_PX); |
| 67 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); | 67 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); |
| 68 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x()
, CSSPrimitiveValue::CSS_PX, true); | 68 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x()
, CSSPrimitiveValue::CSS_PX, true); |
| 69 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY
(), CSSPrimitiveValue::CSS_PX, true); | 69 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY
(), CSSPrimitiveValue::CSS_PX, true); |
| 70 if (document->body()) | 70 if (document->body()) |
| 71 document->body()->appendChild(m_iframe.get(), ASSERT_NO_EXCEPTION_STATE,
AttachLazily); | 71 document->body()->appendChild(m_iframe.get(), ASSERT_NO_EXCEPTION, Attac
hLazily); |
| 72 Frame* contentFrame = m_iframe->contentFrame(); | 72 Frame* contentFrame = m_iframe->contentFrame(); |
| 73 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg
inWriting("text/html", "UTF-8"); | 73 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg
inWriting("text/html", "UTF-8"); |
| 74 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon
troller = parent.internals.pagePopupController;</script>"; | 74 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon
troller = parent.internals.pagePopupController;</script>"; |
| 75 writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePo
pupController)); | 75 writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePo
pupController)); |
| 76 m_popupClient->writeDocument(*writer); | 76 m_popupClient->writeDocument(*writer); |
| 77 contentFrame->loader()->activeDocumentLoader()->endWriting(writer); | 77 contentFrame->loader()->activeDocumentLoader()->endWriting(writer); |
| 78 } | 78 } |
| 79 | 79 |
| 80 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I
ntRect& originBoundsInRootView, Frame* mainFrame) | 80 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I
ntRect& originBoundsInRootView, Frame* mainFrame) |
| 81 { | 81 { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 { | 133 { |
| 134 if (!popup || popup != m_mockPagePopup.get()) | 134 if (!popup || popup != m_mockPagePopup.get()) |
| 135 return; | 135 return; |
| 136 m_mockPagePopup->closeLater(); | 136 m_mockPagePopup->closeLater(); |
| 137 m_mockPagePopup.clear(); | 137 m_mockPagePopup.clear(); |
| 138 m_pagePopupController->clearPagePopupClient(); | 138 m_pagePopupController->clearPagePopupClient(); |
| 139 m_pagePopupController.clear(); | 139 m_pagePopupController.clear(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } | 142 } |
| OLD | NEW |