summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/web/NavigatorContentUtilsClientImpl.cpp
blob: 410ba43318d8c81b55f7026d4a2356198c161ebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "web/NavigatorContentUtilsClientImpl.h"

#include "public/web/WebFrameClient.h"
#include "web/WebLocalFrameImpl.h"

namespace blink {

PassOwnPtrWillBeRawPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::create(WebLocalFrameImpl* webFrame)
{
    return adoptPtrWillBeNoop(new NavigatorContentUtilsClientImpl(webFrame));
}

NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebLocalFrameImpl* webFrame)
    : m_webFrame(webFrame)
{
}

DEFINE_TRACE(NavigatorContentUtilsClientImpl)
{
    visitor->trace(m_webFrame);
    NavigatorContentUtilsClient::trace(visitor);
}

void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& scheme, const KURL& url, const String& title)
{
    m_webFrame->client()->registerProtocolHandler(scheme, url, title);
}

NavigatorContentUtilsClient::CustomHandlersState NavigatorContentUtilsClientImpl::isProtocolHandlerRegistered(const String& scheme, const KURL& url)
{
    return static_cast<NavigatorContentUtilsClient::CustomHandlersState>(m_webFrame->client()->isProtocolHandlerRegistered(scheme, url));
}

void NavigatorContentUtilsClientImpl::unregisterProtocolHandler(const String& scheme, const KURL& url)
{
    m_webFrame->client()->unregisterProtocolHandler(scheme, url);
}

} // namespace blink