Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: Source/core/testing/MockPagePopupDriver.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 PagePopupClient* m_popupClient; 54 PagePopupClient* m_popupClient;
55 RefPtr<HTMLIFrameElement> m_iframe; 55 RefPtr<HTMLIFrameElement> m_iframe;
56 Timer<MockPagePopup> m_closeTimer; 56 Timer<MockPagePopup> m_closeTimer;
57 }; 57 };
58 58
59 inline MockPagePopup::MockPagePopup(PagePopupClient* client, const IntRect& orig inBoundsInRootView, Frame* mainFrame) 59 inline MockPagePopup::MockPagePopup(PagePopupClient* client, const IntRect& orig inBoundsInRootView, Frame* mainFrame)
60 : m_popupClient(client) 60 : m_popupClient(client)
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 ASSERT(document);
65 m_iframe = HTMLIFrameElement::create(HTMLNames::iframeTag, *document);
65 m_iframe->setIdAttribute("mock-page-popup"); 66 m_iframe->setIdAttribute("mock-page-popup");
66 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa lue::CSS_PX); 67 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa lue::CSS_PX);
67 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); 68 m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
68 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x() , CSSPrimitiveValue::CSS_PX, true); 69 m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x() , CSSPrimitiveValue::CSS_PX, true);
69 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY (), CSSPrimitiveValue::CSS_PX, true); 70 m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY (), CSSPrimitiveValue::CSS_PX, true);
70 if (document->body()) 71 if (document->body())
71 document->body()->appendChild(m_iframe.get()); 72 document->body()->appendChild(m_iframe.get());
72 Frame* contentFrame = m_iframe->contentFrame(); 73 Frame* contentFrame = m_iframe->contentFrame();
73 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg inWriting("text/html", "UTF-8"); 74 DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->beg inWriting("text/html", "UTF-8");
74 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon troller = parent.internals.pagePopupController;</script>"; 75 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon troller = parent.internals.pagePopupController;</script>";
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 { 134 {
134 if (!popup || popup != m_mockPagePopup.get()) 135 if (!popup || popup != m_mockPagePopup.get())
135 return; 136 return;
136 m_mockPagePopup->closeLater(); 137 m_mockPagePopup->closeLater();
137 m_mockPagePopup.clear(); 138 m_mockPagePopup.clear();
138 m_pagePopupController->clearPagePopupClient(); 139 m_pagePopupController->clearPagePopupClient();
139 m_pagePopupController.clear(); 140 m_pagePopupController.clear();
140 } 141 }
141 142
142 } 143 }
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698