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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ASSERT(document); | 64 ASSERT(document); |
65 m_iframe = HTMLIFrameElement::create(HTMLNames::iframeTag, *document); | 65 m_iframe = HTMLIFrameElement::create(HTMLNames::iframeTag, *document); |
66 m_iframe->setIdAttribute("mock-page-popup"); | 66 m_iframe->setIdAttribute("mock-page-popup"); |
67 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa
lue::CSS_PX); | 67 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa
lue::CSS_PX); |
68 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); | 68 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); |
69 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x()
, CSSPrimitiveValue::CSS_PX, true); | 69 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x()
, CSSPrimitiveValue::CSS_PX, true); |
70 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY
(), CSSPrimitiveValue::CSS_PX, true); | 70 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY
(), CSSPrimitiveValue::CSS_PX, true); |
71 if (document->body()) | 71 if (document->body()) |
72 document->body()->appendChild(m_iframe.get()); | 72 document->body()->appendChild(m_iframe.get()); |
73 Frame* contentFrame = m_iframe->contentFrame(); | 73 Frame* contentFrame = m_iframe->contentFrame(); |
74 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg
inWriting("text/html", "UTF-8"); | 74 DocumentWriter* writer = contentFrame->loader().activeDocumentLoader()->begi
nWriting("text/html", "UTF-8"); |
75 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon
troller = parent.internals.pagePopupController;</script>"; | 75 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon
troller = parent.internals.pagePopupController;</script>"; |
76 writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePo
pupController)); | 76 writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePo
pupController)); |
77 m_popupClient->writeDocument(*writer); | 77 m_popupClient->writeDocument(*writer); |
78 contentFrame->loader()->activeDocumentLoader()->endWriting(writer); | 78 contentFrame->loader().activeDocumentLoader()->endWriting(writer); |
79 } | 79 } |
80 | 80 |
81 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I
ntRect& originBoundsInRootView, Frame* mainFrame) | 81 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I
ntRect& originBoundsInRootView, Frame* mainFrame) |
82 { | 82 { |
83 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame)
); | 83 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame)
); |
84 } | 84 } |
85 | 85 |
86 void MockPagePopup::closeLater() | 86 void MockPagePopup::closeLater() |
87 { | 87 { |
88 ref(); | 88 ref(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 { | 134 { |
135 if (!popup || popup != m_mockPagePopup.get()) | 135 if (!popup || popup != m_mockPagePopup.get()) |
136 return; | 136 return; |
137 m_mockPagePopup->closeLater(); | 137 m_mockPagePopup->closeLater(); |
138 m_mockPagePopup.clear(); | 138 m_mockPagePopup.clear(); |
139 m_pagePopupController->clearPagePopupClient(); | 139 m_pagePopupController->clearPagePopupClient(); |
140 m_pagePopupController.clear(); | 140 m_pagePopupController.clear(); |
141 } | 141 } |
142 | 142 |
143 } | 143 } |
OLD | NEW |