| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/NavigatorContentUtilsClientImpl.h" | 5 #include "web/NavigatorContentUtilsClientImpl.h" |
| 6 | 6 |
| 7 #include "core/frame/WebLocalFrameBase.h" |
| 7 #include "public/web/WebFrameClient.h" | 8 #include "public/web/WebFrameClient.h" |
| 8 #include "web/WebLocalFrameImpl.h" | |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 NavigatorContentUtilsClientImpl* NavigatorContentUtilsClientImpl::Create( | 12 NavigatorContentUtilsClientImpl* NavigatorContentUtilsClientImpl::Create( |
| 13 WebLocalFrameImpl* web_frame) { | 13 WebLocalFrameBase* web_frame) { |
| 14 return new NavigatorContentUtilsClientImpl(web_frame); | 14 return new NavigatorContentUtilsClientImpl(web_frame); |
| 15 } | 15 } |
| 16 | 16 |
| 17 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl( | 17 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl( |
| 18 WebLocalFrameImpl* web_frame) | 18 WebLocalFrameBase* web_frame) |
| 19 : web_frame_(web_frame) {} | 19 : web_frame_(web_frame) {} |
| 20 | 20 |
| 21 DEFINE_TRACE(NavigatorContentUtilsClientImpl) { | 21 DEFINE_TRACE(NavigatorContentUtilsClientImpl) { |
| 22 visitor->Trace(web_frame_); | 22 visitor->Trace(web_frame_); |
| 23 NavigatorContentUtilsClient::Trace(visitor); | 23 NavigatorContentUtilsClient::Trace(visitor); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void NavigatorContentUtilsClientImpl::RegisterProtocolHandler( | 26 void NavigatorContentUtilsClientImpl::RegisterProtocolHandler( |
| 27 const String& scheme, | 27 const String& scheme, |
| 28 const KURL& url, | 28 const KURL& url, |
| 29 const String& title) { | 29 const String& title) { |
| 30 web_frame_->Client()->RegisterProtocolHandler(scheme, url, title); | 30 web_frame_->Client()->RegisterProtocolHandler(scheme, url, title); |
| 31 } | 31 } |
| 32 | 32 |
| 33 NavigatorContentUtilsClient::CustomHandlersState | 33 NavigatorContentUtilsClient::CustomHandlersState |
| 34 NavigatorContentUtilsClientImpl::IsProtocolHandlerRegistered( | 34 NavigatorContentUtilsClientImpl::IsProtocolHandlerRegistered( |
| 35 const String& scheme, | 35 const String& scheme, |
| 36 const KURL& url) { | 36 const KURL& url) { |
| 37 return static_cast<NavigatorContentUtilsClient::CustomHandlersState>( | 37 return static_cast<NavigatorContentUtilsClient::CustomHandlersState>( |
| 38 web_frame_->Client()->IsProtocolHandlerRegistered(scheme, url)); | 38 web_frame_->Client()->IsProtocolHandlerRegistered(scheme, url)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void NavigatorContentUtilsClientImpl::UnregisterProtocolHandler( | 41 void NavigatorContentUtilsClientImpl::UnregisterProtocolHandler( |
| 42 const String& scheme, | 42 const String& scheme, |
| 43 const KURL& url) { | 43 const KURL& url) { |
| 44 web_frame_->Client()->UnregisterProtocolHandler(scheme, url); | 44 web_frame_->Client()->UnregisterProtocolHandler(scheme, url); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |