| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool MockPagePopup::initialize() | 74 bool MockPagePopup::initialize() |
| 75 { | 75 { |
| 76 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon
troller = parent.internals.pagePopupController;</script>"; | 76 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon
troller = parent.internals.pagePopupController;</script>"; |
| 77 RefPtr<SharedBuffer> data = SharedBuffer::create(scriptToSetUpPagePopupContr
oller, sizeof(scriptToSetUpPagePopupController)); | 77 RefPtr<SharedBuffer> data = SharedBuffer::create(scriptToSetUpPagePopupContr
oller, sizeof(scriptToSetUpPagePopupController)); |
| 78 m_popupClient->writeDocument(data.get()); | 78 m_popupClient->writeDocument(data.get()); |
| 79 LocalFrame* localFrame = toLocalFrame(m_iframe->contentFrame()); | 79 LocalFrame* localFrame = toLocalFrame(m_iframe->contentFrame()); |
| 80 if (!localFrame) | 80 if (!localFrame) |
| 81 return false; | 81 return false; |
| 82 localFrame->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(dat
a, "text/html", "UTF-8", KURL(), ForceSynchronousLoad))); | 82 ResourceRequest request = ResourceRequest(blankURL(), localFrame->isMainFram
e()); |
| 83 localFrame->loader().load(FrameLoadRequest(0, request, SubstituteData(data,
"text/html", "UTF-8", KURL(), ForceSynchronousLoad))); |
| 83 return true; | 84 return true; |
| 84 } | 85 } |
| 85 | 86 |
| 86 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I
ntRect& originBoundsInRootView, LocalFrame* mainFrame) | 87 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I
ntRect& originBoundsInRootView, LocalFrame* mainFrame) |
| 87 { | 88 { |
| 88 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame)
); | 89 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame)
); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void MockPagePopup::closeLater() | 92 void MockPagePopup::closeLater() |
| 92 { | 93 { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 { | 144 { |
| 144 if (!popup || popup != m_mockPagePopup.get()) | 145 if (!popup || popup != m_mockPagePopup.get()) |
| 145 return; | 146 return; |
| 146 m_mockPagePopup->closeLater(); | 147 m_mockPagePopup->closeLater(); |
| 147 m_mockPagePopup.clear(); | 148 m_mockPagePopup.clear(); |
| 148 m_pagePopupController->clearPagePopupClient(); | 149 m_pagePopupController->clearPagePopupClient(); |
| 149 m_pagePopupController.clear(); | 150 m_pagePopupController.clear(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 } | 153 } |
| OLD | NEW |