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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check Created 6 years, 9 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
« no previous file with comments | « Source/core/page/PageSerializer.cpp ('k') | Source/web/ContextMenuClientImpl.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 m_iframe->setIdAttribute("mock-page-popup"); 64 m_iframe->setIdAttribute("mock-page-popup");
65 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa lue::CSS_PX); 65 m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveVa lue::CSS_PX);
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 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon troller = parent.internals.pagePopupController;</script>"; 71 const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupCon troller = parent.internals.pagePopupController;</script>";
72 RefPtr<SharedBuffer> data = SharedBuffer::create(scriptToSetUpPagePopupContr oller, sizeof(scriptToSetUpPagePopupController)); 72 RefPtr<SharedBuffer> data = SharedBuffer::create(scriptToSetUpPagePopupContr oller, sizeof(scriptToSetUpPagePopupController));
73 m_popupClient->writeDocument(data.get()); 73 m_popupClient->writeDocument(data.get());
74 m_iframe->contentFrame()->loader().load(FrameLoadRequest(0, blankURL(), Subs tituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoad))); 74 toLocalFrame(m_iframe->contentFrame())->loader().load(FrameLoadRequest(0, bl ankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoa d)));
75 } 75 }
76 76
77 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I ntRect& originBoundsInRootView, LocalFrame* mainFrame) 77 PassRefPtr<MockPagePopup> MockPagePopup::create(PagePopupClient* client, const I ntRect& originBoundsInRootView, LocalFrame* mainFrame)
78 { 78 {
79 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame) ); 79 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame) );
80 } 80 }
81 81
82 void MockPagePopup::closeLater() 82 void MockPagePopup::closeLater()
83 { 83 {
84 ref(); 84 ref();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 { 130 {
131 if (!popup || popup != m_mockPagePopup.get()) 131 if (!popup || popup != m_mockPagePopup.get())
132 return; 132 return;
133 m_mockPagePopup->closeLater(); 133 m_mockPagePopup->closeLater();
134 m_mockPagePopup.clear(); 134 m_mockPagePopup.clear();
135 m_pagePopupController->clearPagePopupClient(); 135 m_pagePopupController->clearPagePopupClient();
136 m_pagePopupController.clear(); 136 m_pagePopupController.clear();
137 } 137 }
138 138
139 } 139 }
OLDNEW
« no previous file with comments | « Source/core/page/PageSerializer.cpp ('k') | Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698