本文整理汇总了C++中WebLocalFrameImpl::client方法的典型用法代码示例。如果您正苦于以下问题:C++ WebLocalFrameImpl::client方法的具体用法?C++ WebLocalFrameImpl::client怎么用?C++ WebLocalFrameImpl::client使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebLocalFrameImpl
的用法示例。
在下文中一共展示了WebLocalFrameImpl::client方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enterFullScreenForElement
void FullscreenController::enterFullScreenForElement(Element* element)
{
// We are already transitioning to fullscreen for a different element.
if (m_provisionalFullScreenElement) {
m_provisionalFullScreenElement = element;
return;
}
// We are already in fullscreen mode.
if (m_fullScreenFrame) {
m_provisionalFullScreenElement = element;
didEnterFullScreen();
return;
}
// We need to store these values here rather than didEnterFullScreen since
// by the time the latter is called, a Resize has already occured, clamping
// the scroll offset.
if (!m_haveEnteredFullscreen) {
m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor();
m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrollOffset();
m_exitFullscreenVisualViewportOffset = m_webViewImpl->visualViewportOffset();
}
// We need to transition to fullscreen mode.
WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(element->document().frame());
if (frame && frame->client()) {
frame->client()->enterFullscreen();
m_provisionalFullScreenElement = element;
}
}
示例2: openBeforeUnloadConfirmPanelDelegate
bool ChromeClientImpl::openBeforeUnloadConfirmPanelDelegate(LocalFrame* frame,
bool isReload) {
notifyPopupOpeningObservers();
WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
return webframe->client() &&
webframe->client()->runModalBeforeUnloadDialog(isReload);
}
示例3: forwardInputEvent
// FIXME: Remove this code once we have input routing in the browser
// process. See http://crbug.com/339659.
void ChromeClientImpl::forwardInputEvent(
Frame* frame, Event* event)
{
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(toLocalFrame(frame));
// This is only called when we have out-of-process iframes, which
// need to forward input events across processes.
// FIXME: Add a check for out-of-process iframes enabled.
if (event->isKeyboardEvent()) {
WebKeyboardEventBuilder webEvent(*static_cast<KeyboardEvent*>(event));
webFrame->client()->forwardInputEvent(&webEvent);
} else if (event->isMouseEvent()) {
WebMouseEventBuilder webEvent(webFrame->frameView(), 0, *static_cast<MouseEvent*>(event));
// Internal Blink events should not be forwarded.
if (webEvent.type == WebInputEvent::Undefined)
return;
webFrame->client()->forwardInputEvent(&webEvent);
} else if (event->isWheelEvent()) {
WebMouseWheelEventBuilder webEvent(webFrame->frameView(), 0, *static_cast<WheelEvent*>(event));
if (webEvent.type == WebInputEvent::Undefined)
return;
webFrame->client()->forwardInputEvent(&webEvent);
}
}
示例4: adoptPtr
static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, const WebURL& url, LocalFrame* frame)
{
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
if (!webFrame || !webFrame->client())
return nullptr;
return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url, client));
}
示例5: shouldReportDetailedMessageForSource
bool ChromeClientImpl::shouldReportDetailedMessageForSource(
LocalFrame& localFrame,
const String& url) {
WebLocalFrameImpl* webframe =
WebLocalFrameImpl::fromFrame(localFrame.localFrameRoot());
return webframe && webframe->client() &&
webframe->client()->shouldReportDetailedMessageForSource(url);
}
示例6: adoptPtr
static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, const WebURL& url, LocalFrame* frame, WebContentDecryptionModule* initialCdm)
{
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
if (!webFrame || !webFrame->client())
return nullptr;
return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url, client, initialCdm));
}
示例7: runJavaScriptAlert
// Although a LocalFrame is passed in, we don't actually use it, since we
// already know our own m_webView.
void ChromeClientImpl::runJavaScriptAlert(LocalFrame* frame, const String& message)
{
WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
if (webframe->client()) {
if (WebUserGestureIndicator::isProcessingUserGesture())
WebUserGestureIndicator::currentUserGestureToken().setJavascriptPrompt();
webframe->client()->runModalAlertDialog(message);
}
}
示例8: runJavaScriptConfirm
// See comments for runJavaScriptAlert().
bool ChromeClientImpl::runJavaScriptConfirm(LocalFrame* frame, const String& message)
{
WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
if (webframe->client()) {
if (WebUserGestureIndicator::isProcessingUserGesture())
WebUserGestureIndicator::currentUserGestureToken().setJavascriptPrompt();
return webframe->client()->runModalConfirmDialog(message);
}
return false;
}
示例9: postAccessibilityNotification
void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCache::AXNotification notification)
{
// Alert assistive technology about the accessibility object notification.
if (!obj || !obj->document())
return;
WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()->axObjectCacheOwner().frame());
if (webframe && webframe->client())
webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEvent(notification));
}
示例10: addMessageToConsole
void ChromeClientImpl::addMessageToConsole(LocalFrame* localFrame, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID, const String& stackTrace)
{
WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(localFrame);
if (frame && frame->client()) {
frame->client()->didAddMessageToConsole(
WebConsoleMessage(static_cast<WebConsoleMessage::Level>(level), message),
sourceID,
lineNumber,
stackTrace);
}
}
示例11: clearContextMenu
void ContextMenuClientImpl::clearContextMenu()
{
HitTestResult r = m_webView->page()->contextMenuController().hitTestResult();
LocalFrame* selectedFrame = r.innerNodeFrame();
if (!selectedFrame)
return;
WebLocalFrameImpl* selectedWebFrame = WebLocalFrameImpl::fromFrame(selectedFrame);
if (selectedWebFrame->client())
selectedWebFrame->client()->clearContextMenu();
}
示例12: exitFullScreenForElement
void FullscreenController::exitFullScreenForElement(Element* element)
{
ASSERT(element);
// The client is exiting full screen, so don't send a notification.
if (m_isCancelingFullScreen)
return;
WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(element->document().frame());
if (frame && frame->client())
frame->client()->exitFullscreen();
}
示例13: openJavaScriptAlertDelegate
// Although a LocalFrame is passed in, we don't actually use it, since we
// already know our own m_webView.
bool ChromeClientImpl::openJavaScriptAlertDelegate(LocalFrame* frame,
const String& message) {
notifyPopupOpeningObservers();
WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
if (webframe->client()) {
if (WebUserGestureIndicator::isProcessingUserGesture())
WebUserGestureIndicator::currentUserGestureToken().setJavascriptPrompt();
webframe->client()->runModalAlertDialog(message);
return true;
}
return false;
}
示例14: runBeforeUnloadConfirmPanel
bool ChromeClientImpl::runBeforeUnloadConfirmPanel(const String& message, LocalFrame* frame)
{
WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
bool isReload = false;
WebDataSource* ds = webframe->provisionalDataSource();
if (ds)
isReload = (ds->navigationType() == WebNavigationTypeReload);
if (webframe->client())
return webframe->client()->runModalBeforeUnloadDialog(isReload, message);
return false;
}
示例15: createWorkerGlobalScopeProxy
WorkerGlobalScopeProxy* WorkerGlobalScopeProxyProviderImpl::createWorkerGlobalScopeProxy(Worker* worker)
{
if (worker->executionContext()->isDocument()) {
Document* document = toDocument(worker->executionContext());
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create();
provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::create());
providePermissionClientToWorker(workerClients.get(), adoptPtr(webFrame->client()->createWorkerPermissionClientProxy(webFrame)));
provideServiceWorkerContainerClientToWorker(workerClients.get(), adoptPtr(webFrame->client()->createServiceWorkerProvider(webFrame)));
return new WorkerMessagingProxy(worker, workerClients.release());
}
ASSERT_NOT_REACHED();
return 0;
}