OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 } | 1304 } |
1305 | 1305 |
1306 WebPlugin* WebLocalFrameImpl::focusedPluginIfInputMethodSupported() | 1306 WebPlugin* WebLocalFrameImpl::focusedPluginIfInputMethodSupported() |
1307 { | 1307 { |
1308 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame(), WebNode(frame()->document()->focusedElement())); | 1308 WebPluginContainerImpl* container = WebLocalFrameImpl::pluginContainerFromNo
de(frame(), WebNode(frame()->document()->focusedElement())); |
1309 if (container && container->supportsInputMethod()) | 1309 if (container && container->supportsInputMethod()) |
1310 return container->plugin(); | 1310 return container->plugin(); |
1311 return 0; | 1311 return 0; |
1312 } | 1312 } |
1313 | 1313 |
1314 NotificationPresenterImpl* WebLocalFrameImpl::notificationPresenterImpl() | |
1315 { | |
1316 if (!m_notificationPresenter.isInitialized() && m_client) | |
1317 m_notificationPresenter.initialize(m_client->notificationPresenter()); | |
1318 return &m_notificationPresenter; | |
1319 } | |
1320 | |
1321 int WebLocalFrameImpl::printBegin(const WebPrintParams& printParams, const WebNo
de& constrainToNode) | 1314 int WebLocalFrameImpl::printBegin(const WebPrintParams& printParams, const WebNo
de& constrainToNode) |
1322 { | 1315 { |
1323 ASSERT(!frame()->document()->isFrameSet()); | 1316 ASSERT(!frame()->document()->isFrameSet()); |
1324 WebPluginContainerImpl* pluginContainer = 0; | 1317 WebPluginContainerImpl* pluginContainer = 0; |
1325 if (constrainToNode.isNull()) { | 1318 if (constrainToNode.isNull()) { |
1326 // If this is a plugin document, check if the plugin supports its own | 1319 // If this is a plugin document, check if the plugin supports its own |
1327 // printing. If it does, we will delegate all printing to that. | 1320 // printing. If it does, we will delegate all printing to that. |
1328 pluginContainer = pluginContainerFromFrame(frame()); | 1321 pluginContainer = pluginContainerFromFrame(frame()); |
1329 } else { | 1322 } else { |
1330 // We only support printing plugin nodes for now. | 1323 // We only support printing plugin nodes for now. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 | 1586 |
1594 cancelPendingScopingEffort(); | 1587 cancelPendingScopingEffort(); |
1595 } | 1588 } |
1596 | 1589 |
1597 void WebLocalFrameImpl::setWebCoreFrame(PassRefPtr<WebCore::LocalFrame> frame) | 1590 void WebLocalFrameImpl::setWebCoreFrame(PassRefPtr<WebCore::LocalFrame> frame) |
1598 { | 1591 { |
1599 m_frame = frame; | 1592 m_frame = frame; |
1600 | 1593 |
1601 // FIXME: we shouldn't add overhead to every frame by registering these obje
cts when they're not used. | 1594 // FIXME: we shouldn't add overhead to every frame by registering these obje
cts when they're not used. |
1602 if (m_frame) { | 1595 if (m_frame) { |
1603 provideNotification(*m_frame, notificationPresenterImpl()); | 1596 OwnPtr<NotificationPresenterImpl> notificationPresenter = adoptPtr(new N
otificationPresenterImpl()); |
| 1597 if (m_client) |
| 1598 notificationPresenter->initialize(m_client->notificationPresenter())
; |
| 1599 |
| 1600 provideNotification(*m_frame, notificationPresenter.release()); |
1604 provideUserMediaTo(*m_frame, &m_userMediaClientImpl); | 1601 provideUserMediaTo(*m_frame, &m_userMediaClientImpl); |
1605 } | 1602 } |
1606 } | 1603 } |
1607 | 1604 |
1608 void WebLocalFrameImpl::initializeAsMainFrame(WebCore::Page* page) | 1605 void WebLocalFrameImpl::initializeAsMainFrame(WebCore::Page* page) |
1609 { | 1606 { |
1610 setWebCoreFrame(LocalFrame::create(&m_frameLoaderClientImpl, &page->frameHos
t(), 0)); | 1607 setWebCoreFrame(LocalFrame::create(&m_frameLoaderClientImpl, &page->frameHos
t(), 0)); |
1611 | 1608 |
1612 // We must call init() after m_frame is assigned because it is referenced | 1609 // We must call init() after m_frame is assigned because it is referenced |
1613 // during init(). | 1610 // during init(). |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 | 1901 |
1905 void WebLocalFrameImpl::invalidateAll() const | 1902 void WebLocalFrameImpl::invalidateAll() const |
1906 { | 1903 { |
1907 ASSERT(frame() && frame()->view()); | 1904 ASSERT(frame() && frame()->view()); |
1908 FrameView* view = frame()->view(); | 1905 FrameView* view = frame()->view(); |
1909 view->invalidateRect(view->frameRect()); | 1906 view->invalidateRect(view->frameRect()); |
1910 invalidateScrollbar(); | 1907 invalidateScrollbar(); |
1911 } | 1908 } |
1912 | 1909 |
1913 } // namespace blink | 1910 } // namespace blink |
OLD | NEW |