1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "web/NavigatorContentUtilsClientImpl.h"
7
8 #include "public/web/WebViewClient.h"
9 #include "web/WebViewImpl.h"
10
11 namespace blink {
12
create(WebViewImpl * webView)13 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::create(WebViewImpl* webView)
14 {
15 return adoptPtr(new NavigatorContentUtilsClientImpl(webView));
16 }
17
NavigatorContentUtilsClientImpl(WebViewImpl * webView)18 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* webView)
19 : m_webView(webView)
20 {
21 }
22
registerProtocolHandler(const String & scheme,const KURL & url,const String & title)23 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& scheme, const KURL& url, const String& title)
24 {
25 m_webView->client()->registerProtocolHandler(scheme, url, title);
26 }
27
isProtocolHandlerRegistered(const String & scheme,const KURL & url)28 NavigatorContentUtilsClient::CustomHandlersState NavigatorContentUtilsClientImpl::isProtocolHandlerRegistered(const String& scheme, const KURL& url)
29 {
30 return static_cast<NavigatorContentUtilsClient::CustomHandlersState>(m_webView->client()->isProtocolHandlerRegistered(scheme, url));
31 }
32
unregisterProtocolHandler(const String & scheme,const KURL & url)33 void NavigatorContentUtilsClientImpl::unregisterProtocolHandler(const String& scheme, const KURL& url)
34 {
35 m_webView->client()->unregisterProtocolHandler(scheme, url);
36 }
37
38 } // namespace blink
39
40