- Revision
- 109513
- Author
- [email protected]
- Date
- 2012-03-01 22:43:31 -0800 (Thu, 01 Mar 2012)
Log Message
Add HTML-capable popup API to ChromeClient
https://bugs.webkit.org/show_bug.cgi?id=79078
Reviewed by Dimitri Glazkov.
This API will be used to implement a calendar picker of <input type=date>.
The code is enclosed with ENABLE_PAGE_POPUP, and doesn't change any
behavior for now.
* page/ChromeClient.h: Added declarations of openPagePopup() and closePagePopup().
* loader/EmptyClients.h:
(EmptyChromeClient): Add empty implementations of new ChromeClient functions.
* page/PagePopup.h: Added.
(PagePopup): Define an empty interface
* page/PagePopupClient.h: Added.
(PagePopupClient): Define an interface to provide various information to HTMLPopup.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (109512 => 109513)
--- trunk/Source/WebCore/ChangeLog 2012-03-02 06:33:00 UTC (rev 109512)
+++ trunk/Source/WebCore/ChangeLog 2012-03-02 06:43:31 UTC (rev 109513)
@@ -1,3 +1,22 @@
+2012-03-02 Kent Tamura <[email protected]>
+
+ Add HTML-capable popup API to ChromeClient
+ https://bugs.webkit.org/show_bug.cgi?id=79078
+
+ Reviewed by Dimitri Glazkov.
+
+ This API will be used to implement a calendar picker of <input type=date>.
+ The code is enclosed with ENABLE_PAGE_POPUP, and doesn't change any
+ behavior for now.
+
+ * page/ChromeClient.h: Added declarations of openPagePopup() and closePagePopup().
+ * loader/EmptyClients.h:
+ (EmptyChromeClient): Add empty implementations of new ChromeClient functions.
+ * page/PagePopup.h: Added.
+ (PagePopup): Define an empty interface
+ * page/PagePopupClient.h: Added.
+ (PagePopupClient): Define an interface to provide various information to HTMLPopup.
+
2012-03-01 Hironori Bono <[email protected]>
Render overflow controls of an RTL element to its left-side.
Modified: trunk/Source/WebCore/loader/EmptyClients.h (109512 => 109513)
--- trunk/Source/WebCore/loader/EmptyClients.h 2012-03-02 06:33:00 UTC (rev 109512)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2012-03-02 06:43:31 UTC (rev 109513)
@@ -151,6 +151,10 @@
virtual bool hasOpenedPopup() const OVERRIDE { return false; }
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const { return adoptRef(new EmptyPopupMenu()); }
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const { return adoptRef(new EmptySearchPopupMenu()); }
+#if ENABLE(PAGE_POPUP)
+ virtual PagePopup* openPagePopup(PagePopupClient*, const IntRect&) OVERRIDE { return 0; }
+ virtual void closePagePopup(PagePopup*) OVERRIDE { }
+#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String&, const String&, const String&, const String&) { }
Modified: trunk/Source/WebCore/page/ChromeClient.h (109512 => 109513)
--- trunk/Source/WebCore/page/ChromeClient.h 2012-03-02 06:33:00 UTC (rev 109512)
+++ trunk/Source/WebCore/page/ChromeClient.h 2012-03-02 06:43:31 UTC (rev 109513)
@@ -58,6 +58,8 @@
class NavigationAction;
class Node;
class Page;
+ class PagePopup;
+ class PagePopupClient;
class PopupMenuClient;
class SecurityOrigin;
class GraphicsContext3D;
@@ -306,6 +308,12 @@
virtual bool hasOpenedPopup() const = 0;
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const = 0;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const = 0;
+#if ENABLE(PAGE_POPUP)
+ // Creates a PagePopup object, and shows it beside originBoundsInRootView.
+ // The return value can be 0.
+ virtual PagePopup* openPagePopup(PagePopupClient*, const IntRect& originBoundsInRootView) = 0;
+ virtual void closePagePopup(PagePopup*) = 0;
+#endif
virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) { }
Added: trunk/Source/WebCore/page/PagePopup.h (0 => 109513)
--- trunk/Source/WebCore/page/PagePopup.h (rev 0)
+++ trunk/Source/WebCore/page/PagePopup.h 2012-03-02 06:43:31 UTC (rev 109513)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef PagePopup_h
+#define PagePopup_h
+
+#if ENABLE(PAGE_POPUP)
+namespace WebCore {
+
+// A PagePopup object is created by ChromeClient::openPagePopup(), and deleted
+// by ChromeClient::closePagePopup().
+class PagePopup {
+protected:
+ virtual ~PagePopup() { }
+};
+
+}
+#endif
+#endif
Property changes on: trunk/Source/WebCore/page/PagePopup.h
___________________________________________________________________
Added: svn:eol-style
Added: trunk/Source/WebCore/page/PagePopupClient.h (0 => 109513)
--- trunk/Source/WebCore/page/PagePopupClient.h (rev 0)
+++ trunk/Source/WebCore/page/PagePopupClient.h 2012-03-02 06:43:31 UTC (rev 109513)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef PagePopupClient_h
+#define PagePopupClient_h
+
+#if ENABLE(PAGE_POPUP)
+
+#include "IntSize.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class DocumentWriter;
+
+class PagePopupClient {
+public:
+ virtual IntSize contentSize() = 0;
+
+ // Provide an HTML source through the specified DocumentWriter. The HTML
+ // source is rendered in a PagePopup.
+ // The content HTML supports:
+ // - No <select> popups
+ // - No window.resizeBy() and resizeTo()
+ // - window.setValueAndClosePopup(number, string).
+ virtual void writeDocument(DocumentWriter&) = 0;
+
+ // This is called by the content HTML of a PagePopup.
+ // An implementation of this function should call ChromeClient::closePagePopup().
+ virtual void setValueAndClosePopup(int numValue, const String& stringValue) = 0;
+
+ // This is called whenever a PagePopup was closed.
+ virtual void didClosePopup() = 0;
+
+ virtual ~PagePopupClient() { }
+};
+
+}
+#endif
+#endif
Property changes on: trunk/Source/WebCore/page/PagePopupClient.h
___________________________________________________________________
Added: svn:eol-style