Chromium Code Reviews| Index: third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| index 54ac3bdb0f80585628e7aac1b6f24def4b9cc368..47065387c0b23338db5d3b374d96dffe9d27da7d 100644 |
| --- a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp |
| @@ -128,18 +128,13 @@ static bool verifyCustomHandlerScheme(const String& scheme, |
| return false; |
| } |
| -NavigatorContentUtils* NavigatorContentUtils::from(LocalFrame& frame) { |
| +NavigatorContentUtils* NavigatorContentUtils::from(Navigator& navigator) { |
| return static_cast<NavigatorContentUtils*>( |
| - Supplement<LocalFrame>::from(frame, supplementName())); |
| + Supplement<Navigator>::from(navigator, supplementName())); |
| } |
| NavigatorContentUtils::~NavigatorContentUtils() {} |
| -NavigatorContentUtils* NavigatorContentUtils::create( |
| - NavigatorContentUtilsClient* client) { |
| - return new NavigatorContentUtils(client); |
| -} |
| - |
| void NavigatorContentUtils::registerProtocolHandler( |
| Navigator& navigator, |
| const String& scheme, |
| @@ -164,9 +159,8 @@ void NavigatorContentUtils::registerProtocolHandler( |
| ? UseCounter::RegisterProtocolHandlerSecureOrigin |
| : UseCounter::RegisterProtocolHandlerInsecureOrigin); |
| - NavigatorContentUtils::from(*navigator.frame()) |
| - ->client() |
| - ->registerProtocolHandler(scheme, document->completeURL(url), title); |
| + NavigatorContentUtils::from(navigator)->client()->registerProtocolHandler( |
| + scheme, document->completeURL(url), title); |
| } |
| static String customHandlersStateString( |
| @@ -210,7 +204,7 @@ String NavigatorContentUtils::isProtocolHandlerRegistered( |
| return declined; |
| return customHandlersStateString( |
| - NavigatorContentUtils::from(*navigator.frame()) |
| + NavigatorContentUtils::from(navigator) |
| ->client() |
| ->isProtocolHandlerRegistered(scheme, document->completeURL(url))); |
| } |
| @@ -232,25 +226,24 @@ void NavigatorContentUtils::unregisterProtocolHandler( |
| if (!verifyCustomHandlerScheme(scheme, exceptionState)) |
| return; |
| - NavigatorContentUtils::from(*navigator.frame()) |
| - ->client() |
| - ->unregisterProtocolHandler(scheme, document->completeURL(url)); |
| + NavigatorContentUtils::from(navigator)->client()->unregisterProtocolHandler( |
| + scheme, document->completeURL(url)); |
| } |
| DEFINE_TRACE(NavigatorContentUtils) { |
| visitor->trace(m_client); |
| - Supplement<LocalFrame>::trace(visitor); |
| + Supplement<Navigator>::trace(visitor); |
| } |
| const char* NavigatorContentUtils::supplementName() { |
| return "NavigatorContentUtils"; |
| } |
| -void provideNavigatorContentUtilsTo(LocalFrame& frame, |
| - NavigatorContentUtilsClient* client) { |
| - NavigatorContentUtils::provideTo(frame, |
| - NavigatorContentUtils::supplementName(), |
| - NavigatorContentUtils::create(client)); |
| +void NavigatorContentUtils::provideTo(Navigator& navigator, |
| + NavigatorContentUtilsClient* client) { |
| + NavigatorContentUtils::provideTo( |
|
sof
2017/01/13 08:13:46
Drop the NavigatorContentUtils:: namespace qualifi
|
| + navigator, NavigatorContentUtils::supplementName(), |
| + new NavigatorContentUtils(navigator, client)); |
| } |
| } // namespace blink |