summaryrefslogtreecommitdiffstats
path: root/WebCore/page
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/page')
-rw-r--r--WebCore/page/ApplicationInstalledCallback.h45
-rw-r--r--WebCore/page/Navigator.cpp16
-rw-r--r--WebCore/page/Navigator.h12
-rw-r--r--WebCore/page/Navigator.idl5
4 files changed, 72 insertions, 6 deletions
diff --git a/WebCore/page/ApplicationInstalledCallback.h b/WebCore/page/ApplicationInstalledCallback.h
new file mode 100644
index 0000000..503f9e4
--- /dev/null
+++ b/WebCore/page/ApplicationInstalledCallback.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2010, The Android Open Source Project
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
+
+#ifndef ApplicationInstalledCallback_h
+#define ApplicationInstalledCallback_h
+
+#include <wtf/Platform.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class ApplicationInstalledCallback : public RefCounted<ApplicationInstalledCallback> {
+public:
+ virtual ~ApplicationInstalledCallback() { }
+ virtual void handleEvent(bool isInstalled) = 0;
+};
+
+} // namespace WebCore
+
+#endif // ApplicationInstalledCallback_h
+
+#endif // PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
diff --git a/WebCore/page/Navigator.cpp b/WebCore/page/Navigator.cpp
index bcc302f..3c0424f 100644
--- a/WebCore/page/Navigator.cpp
+++ b/WebCore/page/Navigator.cpp
@@ -25,9 +25,6 @@
#include "Chrome.h"
#include "CookieJar.h"
-#if PLATFORM(ANDROID)
-#include "Connection.h"
-#endif
#include "ExceptionCode.h"
#include "Frame.h"
#include "FrameLoader.h"
@@ -45,6 +42,11 @@
#include "Settings.h"
#include "StorageNamespace.h"
+#if PLATFORM(ANDROID)
+#include "ApplicationInstalledCallback.h"
+#include "Connection.h"
+#endif
+
namespace WebCore {
Navigator::Navigator(Frame* frame)
@@ -168,6 +170,14 @@ Connection* Navigator::connection() const
}
#endif
+#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
+void Navigator::isApplicationInstalled(const String& name, PassRefPtr<ApplicationInstalledCallback> callback)
+{
+ //TODO(implement);
+ callback->handleEvent(false);
+}
+#endif
+
#if ENABLE(DOM_STORAGE)
void Navigator::getStorageUpdates()
{
diff --git a/WebCore/page/Navigator.h b/WebCore/page/Navigator.h
index 9967fba..83ed83f 100644
--- a/WebCore/page/Navigator.h
+++ b/WebCore/page/Navigator.h
@@ -27,15 +27,17 @@
namespace WebCore {
-#if PLATFORM(ANDROID)
- class Connection;
-#endif
class Frame;
class Geolocation;
class MimeTypeArray;
class PluginData;
class PluginArray;
class String;
+#if PLATFORM(ANDROID)
+ class ApplicationInstalledCallback;
+ class Connection;
+#endif
+
typedef int ExceptionCode;
@@ -64,6 +66,10 @@ namespace WebCore {
Connection* connection() const;
#endif
+#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
+ void isApplicationInstalled(const String& name, PassRefPtr<ApplicationInstalledCallback> callback);
+#endif
+
#if ENABLE(DOM_STORAGE)
// Relinquishes the storage lock, if one exists.
void getStorageUpdates();
diff --git a/WebCore/page/Navigator.idl b/WebCore/page/Navigator.idl
index 215316f..8eae9d6 100644
--- a/WebCore/page/Navigator.idl
+++ b/WebCore/page/Navigator.idl
@@ -45,6 +45,11 @@ module window {
readonly attribute Connection connection;
#endif
+#if defined(ENABLE_APPLICATION_INSTALLED) && ENABLE_APPLICATION_INSTALLED
+ // ANDROID-only for now.
+ [Custom] void isApplicationInstalled(in DOMString applicationName, in ApplicationInstalledCallback callback);
+#endif
+
#if defined(ENABLE_GEOLOCATION) && ENABLE_GEOLOCATION
readonly attribute [EnabledAtRuntime] Geolocation geolocation;
#endif