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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 bool WebHelperPluginImpl::initializePage(const String& pluginType, const WebDocu
ment& hostDocument) | 199 bool WebHelperPluginImpl::initializePage(const String& pluginType, const WebDocu
ment& hostDocument) |
200 { | 200 { |
201 Page::PageClients pageClients; | 201 Page::PageClients pageClients; |
202 fillWithEmptyClients(pageClients); | 202 fillWithEmptyClients(pageClients); |
203 m_chromeClient = adoptPtr(new HelperPluginChromeClient(this)); | 203 m_chromeClient = adoptPtr(new HelperPluginChromeClient(this)); |
204 pageClients.chromeClient = m_chromeClient.get(); | 204 pageClients.chromeClient = m_chromeClient.get(); |
205 | 205 |
206 m_page = adoptPtr(new Page(pageClients)); | 206 m_page = adoptPtr(new Page(pageClients)); |
207 ASSERT(!m_page->settings().isScriptEnabled()); | 207 ASSERT(!m_page->settings().scriptEnabled()); |
208 m_page->settings().setPluginsEnabled(true); | 208 m_page->settings().setPluginsEnabled(true); |
209 | 209 |
210 m_webView->client()->initializeHelperPluginWebFrame(this); | 210 m_webView->client()->initializeHelperPluginWebFrame(this); |
211 | 211 |
212 // The page's main frame was set in initializeFrame() as a result of the abo
ve call. | 212 // The page's main frame was set in initializeFrame() as a result of the abo
ve call. |
213 Frame* frame = m_page->mainFrame(); | 213 Frame* frame = m_page->mainFrame(); |
214 ASSERT(frame); | 214 ASSERT(frame); |
215 frame->loader().forceSandboxFlags(SandboxAll & ~SandboxPlugins); | 215 frame->loader().forceSandboxFlags(SandboxAll & ~SandboxPlugins); |
216 frame->setView(FrameView::create(frame)); | 216 frame->setView(FrameView::create(frame)); |
217 // No need to set a size or make it not transparent. | 217 // No need to set a size or make it not transparent. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // A WebHelperPluginImpl instance usually has two references. | 257 // A WebHelperPluginImpl instance usually has two references. |
258 // - One owned by the instance itself. It represents the visible widget. | 258 // - One owned by the instance itself. It represents the visible widget. |
259 // - One owned by the hosting element. It's released when the hosting | 259 // - One owned by the hosting element. It's released when the hosting |
260 // element asks the WebHelperPluginImpl to close. | 260 // element asks the WebHelperPluginImpl to close. |
261 // We need them because the closing operation is asynchronous and the widget | 261 // We need them because the closing operation is asynchronous and the widget |
262 // can be closed while the hosting element is unaware of it. | 262 // can be closed while the hosting element is unaware of it. |
263 return adoptRef(new WebHelperPluginImpl(client)).leakRef(); | 263 return adoptRef(new WebHelperPluginImpl(client)).leakRef(); |
264 } | 264 } |
265 | 265 |
266 } // namespace blink | 266 } // namespace blink |
OLD | NEW |