• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 using namespace WebCore;
12 
13 namespace blink {
14 
create(WebViewImpl * webView)15 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::create(WebViewImpl* webView)
16 {
17     return adoptPtr(new NavigatorContentUtilsClientImpl(webView));
18 }
19 
NavigatorContentUtilsClientImpl(WebViewImpl * webView)20 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* webView)
21     : m_webView(webView)
22 {
23 }
24 
registerProtocolHandler(const String & scheme,const WebCore::KURL & baseURL,const WebCore::KURL & url,const String & title)25 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& scheme, const WebCore::KURL& baseURL, const WebCore::KURL& url, const String& title)
26 {
27     m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title);
28 }
29 
isProtocolHandlerRegistered(const String & scheme,const WebCore::KURL & baseURL,const WebCore::KURL & url)30 NavigatorContentUtilsClient::CustomHandlersState NavigatorContentUtilsClientImpl::isProtocolHandlerRegistered(const String& scheme, const WebCore::KURL& baseURL, const WebCore::KURL& url)
31 {
32     return static_cast<NavigatorContentUtilsClient::CustomHandlersState>(m_webView->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
33 }
34 
unregisterProtocolHandler(const String & scheme,const WebCore::KURL & baseURL,const WebCore::KURL & url)35 void NavigatorContentUtilsClientImpl::unregisterProtocolHandler(const String& scheme, const WebCore::KURL& baseURL, const WebCore::KURL& url)
36 {
37     m_webView->client()->unregisterProtocolHandler(scheme, baseURL, url);
38 }
39 
40 } // namespace blink
41 
42