Title: [116536] trunk
Revision
116536
Author
[email protected]
Date
2012-05-09 09:31:24 -0700 (Wed, 09 May 2012)

Log Message

[BlackBerry] Enable PAGE_POPUP in make file, and implement required methods
https://bugs.webkit.org/show_bug.cgi?id=85907

.:

Patch by Crystal Zhang <[email protected]> on 2012-05-09
Reviewed by Rob Buis.

Enable PAGE_POPUP option in make files.

Internal reviewed by Yong Li.

* Source/cmake/OptionsBlackBerry.cmake:
* Source/cmakeconfig.h.cmake:

Source/WebKit/blackberry:

Patch by Crystal Zhang <[email protected]> on 2012-05-09
Reviewed by Rob Buis.

Internal reviewed by Yong Li.

Enable PAGE_POPUP so we can use WebCore::PagePopup and WebCore::PagePopupClient interface.
Implement virtual methods in WebCore::ChromeClientBlackBerry that required for the
implementation and add methods in WebKit::WebPage that needed for PagePopupClient.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
(BlackBerry::WebKit::WebPage::initPopupWebView):
(WebKit):
(BlackBerry::WebKit::WebPage::popupOpened):
(BlackBerry::WebKit::WebPage::popupClosed):
(BlackBerry::WebKit::WebPage::hasOpenedPopup):
(BlackBerry::WebKit::WebPage::popup):
(BlackBerry::WebKit::WebPagePrivate::setParentPopup):
* Api/WebPage.h:
(WebCore):
* Api/WebPage_p.h:
(WebCore):
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::hasOpenedPopup):
(WebCore::ChromeClientBlackBerry::openPagePopup):
(WebCore):
(WebCore::ChromeClientBlackBerry::closePagePopup):
* WebCoreSupport/ChromeClientBlackBerry.h:
(WebCore):
(ChromeClientBlackBerry):

Modified Paths

Diff

Modified: trunk/ChangeLog (116535 => 116536)


--- trunk/ChangeLog	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/ChangeLog	2012-05-09 16:31:24 UTC (rev 116536)
@@ -1,3 +1,17 @@
+2012-05-09  Crystal Zhang  <[email protected]>
+
+        [BlackBerry] Enable PAGE_POPUP in make file, and implement required methods
+        https://bugs.webkit.org/show_bug.cgi?id=85907
+
+        Reviewed by Rob Buis.
+   
+        Enable PAGE_POPUP option in make files.
+
+        Internal reviewed by Yong Li.
+
+        * Source/cmake/OptionsBlackBerry.cmake:
+        * Source/cmakeconfig.h.cmake:
+
 2012-05-09  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Split WebKit2 Makefile moving source code listings to GNUmakefile.list.am

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (116535 => 116536)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-05-09 16:31:24 UTC (rev 116536)
@@ -83,6 +83,7 @@
 #include "Page.h"
 #include "PageCache.h"
 #include "PageGroup.h"
+#include "PagePopupBlackBerry.h"
 #include "PlatformTouchEvent.h"
 #include "PlatformWheelEvent.h"
 #include "PluginDatabase.h"
@@ -373,6 +374,8 @@
     , m_hasInRegionScrollableAreas(false)
     , m_updateDelegatedOverlaysDispatched(false)
     , m_deferredTasksTimer(this, &WebPagePrivate::deferredTasksTimerFired)
+    , m_selectPopup(0)
+    , m_parentPopup(0)
 {
     static bool isInitialized = false;
     if (!isInitialized) {
@@ -3807,6 +3810,9 @@
     if (mouseEvent.type() == WebCore::PlatformEvent::MouseScroll)
         return true;
 
+    if (m_parentPopup)
+        m_parentPopup->handleMouseEvent(mouseEvent);
+
     Node* node = 0;
     if (mouseEvent.inputMethod() == TouchScreen) {
         const FatFingersResult lastFatFingersResult = m_touchEventHandler->lastFatFingersResult();
@@ -5278,6 +5284,11 @@
 }
 #endif
 
+void WebPage::initPopupWebView(BlackBerry::WebKit::WebPage* webPage)
+{
+    d->m_selectPopup->init(webPage);
+}
+
 String WebPagePrivate::findPatternStringForUrl(const KURL& url) const
 {
     if ((m_webSettings->shouldHandlePatternUrls() && protocolIs(url, "pattern"))
@@ -6080,5 +6091,32 @@
     return *defaultUserAgent;
 }
 
+void WebPage::popupOpened(PagePopupBlackBerry* webPopup)
+{
+    ASSERT(!d->m_selectPopup);
+    d->m_selectPopup = webPopup;
 }
+
+void WebPage::popupClosed()
+{
+    ASSERT(d->m_selectPopup);
+    d->m_selectPopup = 0;
 }
+
+bool WebPage::hasOpenedPopup() const
+{
+    return d->m_selectPopup;
+}
+
+PagePopupBlackBerry* WebPage::popup()
+{
+    return d->m_selectPopup;
+}
+
+void WebPagePrivate::setParentPopup(PagePopupBlackBerry* webPopup)
+{
+    m_parentPopup = webPopup;
+}
+
+}
+}

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.h (116535 => 116536)


--- trunk/Source/WebKit/blackberry/Api/WebPage.h	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.h	2012-05-09 16:31:24 UTC (rev 116536)
@@ -38,6 +38,7 @@
 class ChromeClientBlackBerry;
 class Frame;
 class FrameLoaderClientBlackBerry;
+class PagePopupBlackBerry;
 }
 
 class WebDOMDocument;
@@ -332,6 +333,13 @@
     void setUserViewportArguments(const WebViewportArguments&);
     void resetUserViewportArguments();
 
+    // Popup client
+    void initPopupWebView(BlackBerry::WebKit::WebPage*);
+    void popupOpened(WebCore::PagePopupBlackBerry* webPopup);
+    void popupClosed();
+    bool hasOpenedPopup() const;
+    WebCore::PagePopupBlackBerry* popup();
+
 private:
     virtual ~WebPage();
 
@@ -344,6 +352,7 @@
     friend class WebKit::WebPagePrivate;
     friend class WebCore::ChromeClientBlackBerry;
     friend class WebCore::FrameLoaderClientBlackBerry;
+    friend class WebCore::PagePopupBlackBerry;
     WebPagePrivate* d;
 };
 }

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (116535 => 116536)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-05-09 16:31:24 UTC (rev 116536)
@@ -48,6 +48,7 @@
 class RenderObject;
 class ScrollView;
 class TransformationMatrix;
+class PagePopupBlackBerry;
 template<typename T> class Timer;
 }
 
@@ -398,6 +399,8 @@
     void addBackingStoreClientForFrame(const WebCore::Frame*, BackingStoreClient*);
     void removeBackingStoreClientForFrame(const WebCore::Frame*);
 
+    void setParentPopup(WebCore::PagePopupBlackBerry* webPopup);
+
     // Clean up any document related data we might be holding.
     void clearDocumentData(const WebCore::Document*);
 
@@ -579,6 +582,11 @@
     Vector<OwnPtr<DeferredTaskBase> > m_deferredTasks;
     WebCore::Timer<WebPagePrivate> m_deferredTasksTimer;
 
+    // The popup that opened in this webpage
+    WebCore::PagePopupBlackBerry* m_selectPopup;
+    // The popup that owned this webpage
+    WebCore::PagePopupBlackBerry* m_parentPopup;
+
 protected:
     virtual ~WebPagePrivate();
 };

Modified: trunk/Source/WebKit/blackberry/ChangeLog (116535 => 116536)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-05-09 16:31:24 UTC (rev 116536)
@@ -1,3 +1,40 @@
+2012-05-09  Crystal Zhang  <[email protected]>
+
+        [BlackBerry] Enable PAGE_POPUP in make file, and implement required methods
+        https://bugs.webkit.org/show_bug.cgi?id=85907
+
+        Reviewed by Rob Buis.
+
+        Internal reviewed by Yong Li.
+
+        Enable PAGE_POPUP so we can use WebCore::PagePopup and WebCore::PagePopupClient interface.
+        Implement virtual methods in WebCore::ChromeClientBlackBerry that required for the 
+        implementation and add methods in WebKit::WebPage that needed for PagePopupClient.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+        (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
+        (BlackBerry::WebKit::WebPage::initPopupWebView):
+        (WebKit):
+        (BlackBerry::WebKit::WebPage::popupOpened):
+        (BlackBerry::WebKit::WebPage::popupClosed):
+        (BlackBerry::WebKit::WebPage::hasOpenedPopup):
+        (BlackBerry::WebKit::WebPage::popup):
+        (BlackBerry::WebKit::WebPagePrivate::setParentPopup):
+        * Api/WebPage.h:
+        (WebCore):
+        * Api/WebPage_p.h:
+        (WebCore):
+        (WebPagePrivate):
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        (WebCore::ChromeClientBlackBerry::hasOpenedPopup):
+        (WebCore::ChromeClientBlackBerry::openPagePopup):
+        (WebCore):
+        (WebCore::ChromeClientBlackBerry::closePagePopup):
+        * WebCoreSupport/ChromeClientBlackBerry.h:
+        (WebCore):
+        (ChromeClientBlackBerry):
+
 2012-05-08  Jason Liu  <[email protected]>
 
         [BlackBerry] Auth credentials set in private mode are reused in public mode.

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (116535 => 116536)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-05-09 16:31:24 UTC (rev 116536)
@@ -47,6 +47,8 @@
 #include "Page.h"
 #include "PageGroup.h"
 #include "PageGroupLoadDeferrer.h"
+#include "PagePopupBlackBerry.h"
+#include "PagePopupClient.h"
 #include "PlatformString.h"
 #include "PopupMenuBlackBerry.h"
 #include "RenderView.h"
@@ -58,6 +60,7 @@
 #include "WebPage.h"
 #include "WebPageClient.h"
 #include "WebPage_p.h"
+#include "WebPopupType.h"
 #include "WebSettings.h"
 #include "WebString.h"
 #include "WindowFeatures.h"
@@ -282,8 +285,7 @@
 
 bool ChromeClientBlackBerry::hasOpenedPopup() const
 {
-    notImplemented();
-    return false;
+    return m_webPagePrivate->m_webPage->hasOpenedPopup();
 }
 
 PassRefPtr<PopupMenu> ChromeClientBlackBerry::createPopupMenu(PopupMenuClient* client) const
@@ -296,7 +298,32 @@
     return adoptRef(new SearchPopupMenuBlackBerry(client));
 }
 
+PagePopup* ChromeClientBlackBerry::openPagePopup(PagePopupClient* client, const IntRect& originBoundsInRootView)
+{
+    PagePopupBlackBerry* webPopup;
 
+    if (!hasOpenedPopup()) {
+        webPopup = new PagePopupBlackBerry(m_webPagePrivate, client,
+                rootViewToScreen(originBoundsInRootView));
+        m_webPagePrivate->m_webPage->popupOpened(webPopup);
+    } else {
+        webPopup = m_webPagePrivate->m_webPage->popup();
+        webPopup->closeWebPage();
+    }
+    webPopup->sendCreatePopupWebViewRequest();
+    return webPopup;
+}
+
+void ChromeClientBlackBerry::closePagePopup(PagePopup* popup)
+{
+    if (!popup)
+        return;
+
+    PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
+    webPopup->closePopup();
+    m_webPagePrivate->m_webPage->popupClosed();
+}
+
 void ChromeClientBlackBerry::setToolbarsVisible(bool)
 {
     notImplemented();

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h (116535 => 116536)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h	2012-05-09 16:31:24 UTC (rev 116536)
@@ -28,6 +28,8 @@
 }
 
 namespace WebCore {
+class PagePopup;
+class PagePopupClient;
 
 class ChromeClientBlackBerry : public ChromeClient {
 public:
@@ -137,6 +139,9 @@
     virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
     virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
 
+    virtual WebCore::PagePopup* openPagePopup(WebCore::PagePopupClient*, const WebCore::IntRect&);
+    virtual void closePagePopup(WebCore::PagePopup*);
+
 #if USE(ACCELERATED_COMPOSITING)
     virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
     virtual void setNeedsOneShotDrawingSynchronization();

Modified: trunk/Source/cmake/OptionsBlackBerry.cmake (116535 => 116536)


--- trunk/Source/cmake/OptionsBlackBerry.cmake	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/cmake/OptionsBlackBerry.cmake	2012-05-09 16:31:24 UTC (rev 116536)
@@ -146,6 +146,7 @@
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_WEBKIT_BLOB_BUILDER ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ORIENTATION_EVENTS ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_POPUP ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REPAINT_THROTTLING ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REQUEST_ANIMATION_FRAME ON)

Modified: trunk/Source/cmakeconfig.h.cmake (116535 => 116536)


--- trunk/Source/cmakeconfig.h.cmake	2012-05-09 16:21:52 UTC (rev 116535)
+++ trunk/Source/cmakeconfig.h.cmake	2012-05-09 16:31:24 UTC (rev 116536)
@@ -53,6 +53,7 @@
 #cmakedefine01 ENABLE_NOTIFICATIONS
 #cmakedefine01 ENABLE_ORIENTATION_EVENTS
 #cmakedefine01 ENABLE_OVERFLOW_SCROLLING
+#cmakedefine01 ENABLE_PAGE_POPUP
 #cmakedefine01 ENABLE_PAGE_VISIBILITY_API
 #cmakedefine01 ENABLE_PROGRESS_TAG
 #cmakedefine01 ENABLE_REQUEST_ANIMATION_FRAME
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to