15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/* 25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2011, Google Inc. All rights reserved. 35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2012, Samsung Electronics. All rights reserved. 45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without 65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions are met: 75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1. Redistributions of source code must retain the above copyright 95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer. 105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright 115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer in the 125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * documentation and/or other materials provided with the distribution. 135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND 155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE 185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DAMAGE. 255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */ 265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef NavigatorContentUtils_h 285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define NavigatorContentUtils_h 295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "modules/navigatorcontentutils/NavigatorContentUtilsClient.h" 31f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "platform/Supplementable.h" 32f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "platform/heap/Handle.h" 33197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "wtf/OwnPtr.h" 3453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "wtf/text/WTFString.h" 355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 36c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 387757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdochclass ExceptionState; 395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Navigator; 407757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdochclass Page; 415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 42f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liuclass NavigatorContentUtils FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorContentUtils>, public WillBeHeapSupplement<Page> { 43f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorContentUtils); 445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public: 455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual ~NavigatorContentUtils(); 465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 47d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static NavigatorContentUtils* from(Page&); 486f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch static const char* supplementName(); 495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 50d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static void registerProtocolHandler(Navigator&, const String& scheme, const String& url, const String& title, ExceptionState&); 51d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static String isProtocolHandlerRegistered(Navigator&, const String& scheme, const String& url, ExceptionState&); 52d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static void unregisterProtocolHandler(Navigator&, const String& scheme, const String& url, ExceptionState&); 535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 54f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu static PassOwnPtrWillBeRawPtr<NavigatorContentUtils> create(PassOwnPtr<NavigatorContentUtilsClient>); 556f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch 56323480423219ecd77329f8326dc5e0e3b50926d4Torne (Richard Coles) virtual void trace(Visitor* visitor) OVERRIDE { WillBeHeapSupplement<Page>::trace(visitor); } 575c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 58f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) void setClientForTest(PassOwnPtr<NavigatorContentUtilsClient> client) { m_client = client; } 59f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) 605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private: 61aafa69cb17c9d6606c07663ade5f81388a2c5986Ben Murdoch explicit NavigatorContentUtils(PassOwnPtr<NavigatorContentUtilsClient> client) 625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) : m_client(client) 635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) { } 645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 65aafa69cb17c9d6606c07663ade5f81388a2c5986Ben Murdoch NavigatorContentUtilsClient* client() { return m_client.get(); } 665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 67aafa69cb17c9d6606c07663ade5f81388a2c5986Ben Murdoch OwnPtr<NavigatorContentUtilsClient> m_client; 685c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}; 695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 70c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink 715c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#endif // NavigatorContentUtils_h 73