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