106c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu/* 206c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * Copyright 2010, The Android Open Source Project 306c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * 406c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * Redistribution and use in source and binary forms, with or without 506c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * modification, are permitted provided that the following conditions 606c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * are met: 706c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * * Redistributions of source code must retain the above copyright 806c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * notice, this list of conditions and the following disclaimer. 906c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * * Redistributions in binary form must reproduce the above copyright 1006c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * notice, this list of conditions and the following disclaimer in the 1106c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * documentation and/or other materials provided with the distribution. 1206c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * 1306c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 1406c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1506c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1606c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 1706c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1806c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1906c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 2006c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 2106c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2206c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2306c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2406c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu */ 2506c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED) 2606c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 2706c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#ifndef JSCustomApplicationInstalledCallback_h 2806c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#define JSCustomApplicationInstalledCallback_h 2906c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 3006c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#include "ApplicationInstalledCallback.h" 3106c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#include "JSCallbackData.h" 3206c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#include <wtf/PassRefPtr.h> 3306c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#include <wtf/RefPtr.h> 3406c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 3506c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescunamespace WebCore { 3606c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 3706c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescuclass JSCustomApplicationInstalledCallback : public ApplicationInstalledCallback { 3806c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescupublic: 3906c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu static PassRefPtr<JSCustomApplicationInstalledCallback> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject) 4006c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu { 4106c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu return adoptRef(new JSCustomApplicationInstalledCallback(callback, globalObject)); 4206c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu } 4306c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 4406c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu virtual void handleEvent(bool isInstalled); 4506c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 4606c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescuprivate: 4706c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu JSCustomApplicationInstalledCallback(JSC::JSObject* callback, JSDOMGlobalObject* globalObject); 4806c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 4906c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu JSCallbackData m_data; 5006c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu}; 5106c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 5206c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu} // namespace WebCore 5306c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 5406c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#endif // JSCustomApplicationInstalledCallback_h 5506c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu 5606c8f75ebb768453c256ee2140fb5392ed35bc13Andrei Popescu#endif // PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED) 57