Changeset 150434 in webkit


Ignore:
Timestamp:
May 21, 2013 3:55:57 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Make PagePopup implementation independent from WebCore
https://bugs.webkit.org/show_bug.cgi?id=116448

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-05-21
Reviewed by Anders Carlsson.

.:

  • Source/cmake/OptionsBlackBerry.cmake: Do not enable PAGE_POPUP

feature.

Source/WebKit:

  • PlatformBlackBerry.cmake: Add

blackberry/WebCoreSupport/PagePopupBlackBerryClient.cpp to
compilation.

Source/WebKit/blackberry:

Add our own implementation of PagePopupClient and make all the
pickers inherit from it. Unused methods have been removed and
common implementation have been moved from the pickers to the
parent class.

  • Api/WebPage.cpp:

(BlackBerry::WebKit::WebPagePrivate::~WebPagePrivate): Destroy the
popup if there's one active.
(BlackBerry::WebKit::WebPagePrivate::setVisible): Call
closePagePopup() directly.
(BlackBerry::WebKit::WebPagePrivate::openPagePopup): Create a new
PagePopupBlackBerry for the given client.
(BlackBerry::WebKit::WebPagePrivate::closePagePopup): Close the
active popup if there's one.
(BlackBerry::WebKit::WebPagePrivate::hasOpenedPopup): Return
whether there's an active popup.

  • Api/WebPage.h:
  • Api/WebPage_p.h:
  • WebCoreSupport/ChromeClientBlackBerry.cpp:

(WebCore::ChromeClientBlackBerry::chromeDestroyed): Remove
closePagePopup() call since this is now handled by
WebPagePrivate.
(WebCore::ChromeClientBlackBerry::hasOpenedPopup): Call
WebPagePrivate::hasOpenedPopup().

  • WebCoreSupport/ChromeClientBlackBerry.h:

(ChromeClientBlackBerry):

  • WebCoreSupport/ColorPickerClient.cpp:

(BlackBerry::WebKit::ColorPickerClient::ColorPickerClient):
(BlackBerry::WebKit::ColorPickerClient::didClosePopup):

  • WebCoreSupport/ColorPickerClient.h:

(ColorPickerClient):

  • WebCoreSupport/DatePickerClient.cpp:

(BlackBerry::WebKit::DatePickerClient::DatePickerClient):
(BlackBerry::WebKit::DatePickerClient::didClosePopup):

  • WebCoreSupport/DatePickerClient.h:

(DatePickerClient):

  • WebCoreSupport/PagePopupBlackBerry.cpp:

(BlackBerry::WebKit::PagePopupBlackBerry::PagePopupBlackBerry):
(BlackBerry::WebKit::PagePopupBlackBerry::closePopup):

  • WebCoreSupport/PagePopupBlackBerry.h:

(PagePopupBlackBerry):
(BlackBerry::WebKit::PagePopupBlackBerry::SharedClientPointer::SharedClientPointer):
(BlackBerry::WebKit::PagePopupBlackBerry::SharedClientPointer::get):
(SharedClientPointer):

  • WebCoreSupport/PagePopupBlackBerryClient.cpp: Added.

(BlackBerry::WebKit::PagePopupBlackBerryClient::PagePopupBlackBerryClient):
(BlackBerry::WebKit::PagePopupBlackBerryClient::closePopup):
(BlackBerry::WebKit::PagePopupBlackBerryClient::didClosePopup):
(BlackBerry::WebKit::PagePopupBlackBerryClient::contentSize):
(BlackBerry::WebKit::PagePopupBlackBerryClient::writeDocument):

  • WebCoreSupport/PagePopupBlackBerryClient.h: Added.

(PagePopupBlackBerryClient):
(BlackBerry::WebKit::PagePopupBlackBerryClient::~PagePopupBlackBerryClient):

  • WebCoreSupport/SelectPopupClient.cpp:

(BlackBerry::WebKit::SelectPopupClient::SelectPopupClient):
(BlackBerry::WebKit::SelectPopupClient::didClosePopup):

  • WebCoreSupport/SelectPopupClient.h:

(SelectPopupClient):

  • WebKitSupport/InputHandler.cpp:

(BlackBerry::WebKit::InputHandler::openDatePopup): Do not call
closePagePopup() since this is already done by openPagePopup() and
use openPagePopup() from WebPagePrivate directly.
(BlackBerry::WebKit::InputHandler::openColorPopup): Ditto.
(BlackBerry::WebKit::InputHandler::openSelectPopup): Ditto.

Location:
trunk
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r150368 r150434  
     12013-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [BlackBerry] Make PagePopup implementation independent from WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=116448
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Source/cmake/OptionsBlackBerry.cmake: Do not enable PAGE_POPUP
     9        feature.
     10
    1112013-05-20  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    212
  • trunk/Source/WebKit/ChangeLog

    r150336 r150434  
     12013-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [BlackBerry] Make PagePopup implementation independent from WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=116448
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * PlatformBlackBerry.cmake: Add
     9        blackberry/WebCoreSupport/PagePopupBlackBerryClient.cpp to
     10        compilation.
     11
    1122013-05-18  Patrick Gansterer  <paroga@webkit.org>
    213
  • trunk/Source/WebKit/PlatformBlackBerry.cmake

    r150336 r150434  
    103103    blackberry/WebCoreSupport/NotificationClientBlackBerry.cpp
    104104    blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
     105    blackberry/WebCoreSupport/PagePopupBlackBerryClient.cpp
    105106    blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp
    106107    blackberry/WebCoreSupport/NavigatorContentUtilsClientBlackBerry.cpp
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r150274 r150434  
    102102#include "PageGroup.h"
    103103#include "PagePopupBlackBerry.h"
     104#include "PagePopupBlackBerryClient.h"
    104105#include "PlatformTouchEvent.h"
    105106#include "PlatformWheelEvent.h"
     
    464465    cancelCallOnMainThread(handleServiceScriptedAnimationsOnMainThread, this);
    465466#endif
     467
     468    closePagePopup();
    466469
    467470    delete m_webSettings;
     
    31503153                m_page->suspendScriptedAnimations();
    31513154
    3152             if (m_webPage->hasOpenedPopup())
    3153                 m_page->chrome().client()->closePagePopup(0);
     3155            closePagePopup();
    31543156        }
    31553157
     
    60676069}
    60686070
    6069 void WebPage::popupOpened(PagePopupBlackBerry* webPopup)
    6070 {
    6071     ASSERT(!d->m_selectPopup);
    6072     d->m_selectPopup = webPopup;
    6073 }
    6074 
    6075 void WebPage::popupClosed()
    6076 {
    6077     ASSERT(d->m_selectPopup);
    6078     d->m_selectPopup = 0;
    6079 }
    6080 
    6081 bool WebPage::hasOpenedPopup() const
    6082 {
    6083     return d->m_selectPopup;
    6084 }
    6085 
    6086 PagePopupBlackBerry* WebPage::popup()
    6087 {
    6088     return d->m_selectPopup;
     6071bool WebPagePrivate::openPagePopup(PagePopupBlackBerryClient* popupClient, const WebCore::IntRect& originBoundsInRootView)
     6072{
     6073    closePagePopup();
     6074    m_selectPopup = new PagePopupBlackBerry(this, popupClient);
     6075
     6076    WebCore::IntRect popupRect = m_page->chrome().client()->rootViewToScreen(originBoundsInRootView);
     6077    popupRect.setSize(popupClient->contentSize());
     6078    if (!m_client->createPopupWebView(popupRect)) {
     6079        closePagePopup();
     6080        return false;
     6081    }
     6082
     6083    return true;
     6084}
     6085
     6086void WebPagePrivate::closePagePopup()
     6087{
     6088    if (!m_selectPopup)
     6089        return;
     6090
     6091    m_selectPopup->closePopup();
     6092    m_client->closePopupWebView();
     6093    delete m_selectPopup;
     6094    m_selectPopup = 0;
     6095}
     6096
     6097bool WebPagePrivate::hasOpenedPopup() const
     6098{
     6099    return m_selectPopup;
    60896100}
    60906101
  • trunk/Source/WebKit/blackberry/Api/WebPage.h

    r149769 r150434  
    3737class Frame;
    3838class FrameLoaderClientBlackBerry;
    39 class PagePopupBlackBerry;
    4039}
    4140
     
    6362class BackingStorePrivate;
    6463class InRegionScroller;
     64class PagePopupBlackBerry;
    6565class RenderQueue;
    6666class WebCookieJar;
     
    369369    // Popup client
    370370    void initPopupWebView(BlackBerry::WebKit::WebPage*);
    371     void popupOpened(WebCore::PagePopupBlackBerry* webPopup);
    372     void popupClosed();
    373     bool hasOpenedPopup() const;
    374     WebCore::PagePopupBlackBerry* popup();
    375371
    376372    void autofillTextField(const BlackBerry::Platform::String&);
     
    394390    friend class WebKit::BackingStoreClient;
    395391    friend class WebKit::BackingStorePrivate;
     392    friend class WebKit::PagePopupBlackBerry;
    396393    friend class WebKit::RenderQueue;
    397394    friend class WebKit::WebPageCompositor;
     
    400397    friend class WebCore::ChromeClientBlackBerry;
    401398    friend class WebCore::FrameLoaderClientBlackBerry;
    402     friend class WebCore::PagePopupBlackBerry;
    403399    WebPagePrivate* d;
    404400};
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r150091 r150434  
    6969class ScrollView;
    7070class TransformationMatrix;
    71 class PagePopupBlackBerry;
    7271template<typename T> class Timer;
    7372}
     
    8180class InPageSearchManager;
    8281class InputHandler;
     82class PagePopupBlackBerry;
     83class PagePopupBlackBerryClient;
    8384class SelectionHandler;
    8485class TouchEventHandler;
     
    413414    BackingStoreClient* backingStoreClient() const;
    414415
    415     void setParentPopup(WebCore::PagePopupBlackBerry* webPopup);
     416    bool openPagePopup(PagePopupBlackBerryClient*, const WebCore::IntRect& originBoundsInRootView);
     417    void closePagePopup();
     418    bool hasOpenedPopup() const;
    416419
    417420    // Clean up any document related data we might be holding.
     
    636639
    637640    // The popup that opened in this webpage
    638     WebCore::PagePopupBlackBerry* m_selectPopup;
     641    PagePopupBlackBerry* m_selectPopup;
    639642
    640643    RefPtr<WebCore::AutofillManager> m_autofillManager;
  • trunk/Source/WebKit/blackberry/ChangeLog

    r150361 r150434  
     12013-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [BlackBerry] Make PagePopup implementation independent from WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=116448
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Add our own implementation of PagePopupClient and make all the
     9        pickers inherit from it. Unused methods have been removed and
     10        common implementation have been moved from the pickers to the
     11        parent class.
     12
     13        * Api/WebPage.cpp:
     14        (BlackBerry::WebKit::WebPagePrivate::~WebPagePrivate): Destroy the
     15        popup if there's one active.
     16        (BlackBerry::WebKit::WebPagePrivate::setVisible): Call
     17        closePagePopup() directly.
     18        (BlackBerry::WebKit::WebPagePrivate::openPagePopup): Create a new
     19        PagePopupBlackBerry for the given client.
     20        (BlackBerry::WebKit::WebPagePrivate::closePagePopup): Close the
     21        active popup if there's one.
     22        (BlackBerry::WebKit::WebPagePrivate::hasOpenedPopup): Return
     23        whether there's an active popup.
     24        * Api/WebPage.h:
     25        * Api/WebPage_p.h:
     26        * WebCoreSupport/ChromeClientBlackBerry.cpp:
     27        (WebCore::ChromeClientBlackBerry::chromeDestroyed): Remove
     28        closePagePopup() call since this is now handled by
     29        WebPagePrivate.
     30        (WebCore::ChromeClientBlackBerry::hasOpenedPopup): Call
     31        WebPagePrivate::hasOpenedPopup().
     32        * WebCoreSupport/ChromeClientBlackBerry.h:
     33        (ChromeClientBlackBerry):
     34        * WebCoreSupport/ColorPickerClient.cpp:
     35        (BlackBerry::WebKit::ColorPickerClient::ColorPickerClient):
     36        (BlackBerry::WebKit::ColorPickerClient::didClosePopup):
     37        * WebCoreSupport/ColorPickerClient.h:
     38        (ColorPickerClient):
     39        * WebCoreSupport/DatePickerClient.cpp:
     40        (BlackBerry::WebKit::DatePickerClient::DatePickerClient):
     41        (BlackBerry::WebKit::DatePickerClient::didClosePopup):
     42        * WebCoreSupport/DatePickerClient.h:
     43        (DatePickerClient):
     44        * WebCoreSupport/PagePopupBlackBerry.cpp:
     45        (BlackBerry::WebKit::PagePopupBlackBerry::PagePopupBlackBerry):
     46        (BlackBerry::WebKit::PagePopupBlackBerry::closePopup):
     47        * WebCoreSupport/PagePopupBlackBerry.h:
     48        (PagePopupBlackBerry):
     49        (BlackBerry::WebKit::PagePopupBlackBerry::SharedClientPointer::SharedClientPointer):
     50        (BlackBerry::WebKit::PagePopupBlackBerry::SharedClientPointer::get):
     51        (SharedClientPointer):
     52        * WebCoreSupport/PagePopupBlackBerryClient.cpp: Added.
     53        (BlackBerry::WebKit::PagePopupBlackBerryClient::PagePopupBlackBerryClient):
     54        (BlackBerry::WebKit::PagePopupBlackBerryClient::closePopup):
     55        (BlackBerry::WebKit::PagePopupBlackBerryClient::didClosePopup):
     56        (BlackBerry::WebKit::PagePopupBlackBerryClient::contentSize):
     57        (BlackBerry::WebKit::PagePopupBlackBerryClient::writeDocument):
     58        * WebCoreSupport/PagePopupBlackBerryClient.h: Added.
     59        (PagePopupBlackBerryClient):
     60        (BlackBerry::WebKit::PagePopupBlackBerryClient::~PagePopupBlackBerryClient):
     61        * WebCoreSupport/SelectPopupClient.cpp:
     62        (BlackBerry::WebKit::SelectPopupClient::SelectPopupClient):
     63        (BlackBerry::WebKit::SelectPopupClient::didClosePopup):
     64        * WebCoreSupport/SelectPopupClient.h:
     65        (SelectPopupClient):
     66        * WebKitSupport/InputHandler.cpp:
     67        (BlackBerry::WebKit::InputHandler::openDatePopup): Do not call
     68        closePagePopup() since this is already done by openPagePopup() and
     69        use openPagePopup() from WebPagePrivate directly.
     70        (BlackBerry::WebKit::InputHandler::openColorPopup): Ditto.
     71        (BlackBerry::WebKit::InputHandler::openSelectPopup): Ditto.
     72
    1732013-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    274
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp

    r150071 r150434  
    4848#include "PageGroup.h"
    4949#include "PageGroupLoadDeferrer.h"
    50 #include "PagePopupBlackBerry.h"
    51 #include "PagePopupClient.h"
    5250#include "PopupMenuBlackBerry.h"
    5351#include "RenderView.h"
     
    151149void ChromeClientBlackBerry::chromeDestroyed()
    152150{
    153     // Destroy popup if we have.
    154     closePagePopup(0);
    155151    delete this;
    156152}
     
    301297bool ChromeClientBlackBerry::hasOpenedPopup() const
    302298{
    303     return m_webPagePrivate->m_webPage->hasOpenedPopup();
     299    return m_webPagePrivate->hasOpenedPopup();
    304300}
    305301
     
    312308{
    313309    return adoptRef(new SearchPopupMenuBlackBerry(client));
    314 }
    315 
    316 PagePopup* ChromeClientBlackBerry::openPagePopup(PagePopupClient* client, const IntRect& originBoundsInRootView)
    317 {
    318     closePagePopup(0);
    319 
    320     PagePopupBlackBerry* webPopup = new PagePopupBlackBerry(m_webPagePrivate, client, rootViewToScreen(originBoundsInRootView));
    321     m_webPagePrivate->m_webPage->popupOpened(webPopup);
    322     if (webPopup->sendCreatePopupWebViewRequest())
    323         return webPopup;
    324 
    325     closePagePopup(0);
    326     return 0;
    327 }
    328 
    329 void ChromeClientBlackBerry::closePagePopup(PagePopup*)
    330 {
    331     if (!hasOpenedPopup())
    332         return;
    333 
    334     PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
    335     webPopup->closePopup();
    336     delete webPopup;
    337310}
    338311
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h

    r150353 r150434  
    2929
    3030namespace WebCore {
    31 class PagePopup;
    32 class PagePopupClient;
    3331
    3432class ChromeClientBlackBerry : public ChromeClient {
     
    141139    virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
    142140
    143     virtual WebCore::PagePopup* openPagePopup(WebCore::PagePopupClient*, const WebCore::IntRect&);
    144     virtual void closePagePopup(WebCore::PagePopup*);
    145 
    146141#if USE(ACCELERATED_COMPOSITING)
    147142    virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ColorPickerClient.cpp

    r150214 r150434  
    2020#include "ColorPickerClient.h"
    2121
    22 #include "Chrome.h"
    23 #include "ChromeClient.h"
    24 #include "Document.h"
    25 #include "DocumentWriter.h"
    2622#include "HTMLInputElement.h"
    27 #include "NotImplemented.h"
    28 #include "Page.h"
    29 #include "PagePopup.h"
    3023#include "PopupPicker.h"
    31 #include "RenderObject.h"
    3224#include "WebPage_p.h"
    3325
     
    3729#include <wtf/text/StringBuilder.h>
    3830
    39 namespace WebCore {
     31using namespace WebCore;
     32
     33namespace BlackBerry {
     34namespace WebKit {
    4035
    4136DEFINE_STATIC_LOCAL(BlackBerry::Platform::LocalizeResource, s_resource, ());
    4237
    43 ColorPickerClient::ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate* webPage, HTMLInputElement* element)
    44     : m_webPage(webPage)
     38ColorPickerClient::ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate* webPage, WebCore::HTMLInputElement* element)
     39    : PagePopupBlackBerryClient(webPage)
    4540    , m_element(element)
    4641{
     
    8580}
    8681
    87 void ColorPickerClient::closePopup()
    88 {
    89     ASSERT(m_webPage);
    90     m_webPage->m_page->chrome().client()->closePagePopup(0);
    91 }
    92 
    93 IntSize ColorPickerClient::contentSize()
    94 {
    95     // FIXME: will generate content size dynamically
    96     return IntSize(320, 256);
    97 }
    98 
    99 String ColorPickerClient::htmlSource() const
    100 {
    101     return m_source;
    102 }
    103 
    104 Locale& ColorPickerClient::locale()
    105 {
    106     return m_element->document()->getCachedLocale();
    107 }
    108 
    10982void ColorPickerClient::setValueAndClosePopup(int, const String& value)
    11083{
     
    11790}
    11891
    119 void ColorPickerClient::setValue(const String&)
    120 {
    121     notImplemented();
    122 }
    123 
    12492void ColorPickerClient::didClosePopup()
    12593{
    126     m_webPage = 0;
     94    PagePopupBlackBerryClient::didClosePopup();
    12795    m_element = 0;
    12896}
    12997
    130 void ColorPickerClient::writeDocument(DocumentWriter& writer)
    131 {
    132     CString sourceString = m_source.utf8();
    133     writer.addData(sourceString.data(), sourceString.length());
    13498}
    13599}
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ColorPickerClient.h

    r143607 r150434  
    2020#define ColorPickerClient_h
    2121
    22 #include "PagePopupClient.h"
     22#include "PagePopupBlackBerryClient.h"
    2323#include <BlackBerryPlatformInputEvents.h>
     24
     25namespace WebCore {
     26class HTMLInputElement;
     27}
    2428
    2529namespace BlackBerry {
     
    2933
    3034namespace WebKit {
    31 class WebPagePrivate;
    32 }
    33 }
    3435
    35 namespace WebCore {
    36 class DocumentWriter;
    37 class HTMLInputElement;
     36class ColorPickerClient : public PagePopupBlackBerryClient {
     37public:
     38    ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate*, WebCore::HTMLInputElement*);
    3839
    39 class ColorPickerClient : public PagePopupClient {
    40 public:
    41     ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate*, HTMLInputElement*);
    42 
    43     void generateHTML(const BlackBerry::Platform::String& value);
    44     void writeDocument(DocumentWriter&);
    45     IntSize contentSize();
    46     String htmlSource() const;
    47     virtual Locale& locale();
    4840    void setValueAndClosePopup(int, const String&);
    49     void setValue(const String&);
    50     void closePopup();
    5141    void didClosePopup();
    5242
    5343private:
    54     String m_source;
    55     BlackBerry::WebKit::WebPagePrivate* m_webPage;
    56     RefPtr<HTMLInputElement> m_element;
     44    void generateHTML(const BlackBerry::Platform::String& value);
     45
     46    RefPtr<WebCore::HTMLInputElement> m_element;
    5747};
    58 } // namespace WebCore
     48
     49}
     50}
    5951#endif
  • trunk/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp

    r150214 r150434  
    2020#include "DatePickerClient.h"
    2121
    22 #include "Chrome.h"
    23 #include "ChromeClient.h"
    2422#include "Document.h"
    25 #include "DocumentWriter.h"
    2623#include "Frame.h"
    2724#include "HTMLInputElement.h"
    28 #include "NotImplemented.h"
    29 #include "Page.h"
    30 #include "PagePopup.h"
    3125#include "PopupPicker.h"
    32 #include "RenderObject.h"
    3326#include "WebPage_p.h"
    3427
     
    3932#include <wtf/text/StringBuilder.h>
    4033
     34using namespace WebCore;
    4135using namespace icu;
    4236
    43 namespace WebCore {
     37namespace BlackBerry {
     38namespace WebKit {
    4439
    4540DEFINE_STATIC_LOCAL(BlackBerry::Platform::LocalizeResource, s_resource, ());
    4641
    47 DatePickerClient::DatePickerClient(BlackBerry::Platform::BlackBerryInputType type, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step, BlackBerry::WebKit::WebPagePrivate* webPage, HTMLInputElement* element)
    48     : m_type(type)
    49     , m_webPage(webPage)
     42DatePickerClient::DatePickerClient(BlackBerry::Platform::BlackBerryInputType type, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step, BlackBerry::WebKit::WebPagePrivate* webPage, WebCore::HTMLInputElement* element)
     43    : PagePopupBlackBerryClient(webPage)
     44    , m_type(type)
    5045    , m_element(element)
    5146{
     
    139134}
    140135
    141 void DatePickerClient::closePopup()
    142 {
    143     ASSERT(m_webPage);
    144     m_webPage->m_page->chrome().client()->closePagePopup(0);
    145 }
    146 
    147 IntSize DatePickerClient::contentSize()
    148 {
    149     // Fixme: will generate content size dynamically
    150     return IntSize(320, 256);
    151 }
    152 
    153 String DatePickerClient::htmlSource()
    154 {
    155     return m_source;
    156 }
    157 
    158 Locale& DatePickerClient::locale()
    159 {
    160     return m_element->document()->getCachedLocale();
    161 }
    162 
    163136void DatePickerClient::setValueAndClosePopup(int, const String& value)
    164137{
     
    174147}
    175148
    176 void DatePickerClient::setValue(const String&)
    177 {
    178     notImplemented();
    179 }
    180 
    181149void DatePickerClient::didClosePopup()
    182150{
    183     m_webPage = 0;
     151    PagePopupBlackBerryClient::didClosePopup();
    184152    m_element = 0;
    185 }
    186 
    187 void DatePickerClient::writeDocument(DocumentWriter& writer)
    188 {
    189     writer.addData(m_source.utf8().data(), m_source.utf8().length());
    190153}
    191154
     
    240203    return printedLabels.toString();
    241204}
    242 }
     205
     206}
     207}
  • trunk/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.h

    r149814 r150434  
    2020#define DatePickerClient_h
    2121
    22 #include "PagePopupClient.h"
     22#include "PagePopupBlackBerryClient.h"
    2323#include <BlackBerryPlatformInputEvents.h>
    2424#include <unicode/udat.h>
     25
     26namespace WebCore {
     27class HTMLInputElement;
     28}
    2529
    2630namespace BlackBerry {
     
    3135namespace WebKit {
    3236class WebPagePrivate;
    33 }
    34 }
    3537
    36 namespace WebCore {
    37 class DocumentWriter;
    38 class HTMLInputElement;
    39 
    40 class DatePickerClient : public PagePopupClient {
     38class DatePickerClient : public PagePopupBlackBerryClient {
    4139public:
    42     DatePickerClient(BlackBerry::Platform::BlackBerryInputType, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step, BlackBerry::WebKit::WebPagePrivate*, HTMLInputElement*);
     40    DatePickerClient(BlackBerry::Platform::BlackBerryInputType, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step, BlackBerry::WebKit::WebPagePrivate*, WebCore::HTMLInputElement*);
    4341    ~DatePickerClient();
    4442
    45     void generateHTML(BlackBerry::Platform::BlackBerryInputType, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step);
    46 
    47     void writeDocument(DocumentWriter&);
    48     virtual IntSize contentSize();
    49     virtual String htmlSource();
    50     virtual Locale& locale();
    5143    void setValueAndClosePopup(int, const String&);
    52     void setValue(const String&);
    5344    void didClosePopup();
    54     void closePopup();
    5545
    5646private:
     47    void generateHTML(BlackBerry::Platform::BlackBerryInputType, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step);
    5748    static const String generateDateLabels(UDateFormatSymbolType);
    5849
    5950    BlackBerry::Platform::BlackBerryInputType m_type;
    60     String m_source;
    61     BlackBerry::WebKit::WebPagePrivate* m_webPage;
    62     RefPtr<HTMLInputElement> m_element;
     51    RefPtr<WebCore::HTMLInputElement> m_element;
    6352};
    64 } // namespace WebCore
     53
     54}
     55}
    6556#endif
  • trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp

    r149815 r150434  
    1717 */
    1818#include "config.h"
    19 
    2019#include "PagePopupBlackBerry.h"
    2120
    2221#include "DocumentLoader.h"
     22#include "DocumentWriter.h"
    2323#include "EmptyClients.h"
    2424#include "FrameView.h"
     
    2727#include "JSObject.h"
    2828#include "JSRetainPtr.h"
    29 #include "Page.h"
    30 #include "PageGroup.h"
    31 #include "PagePopupClient.h"
    32 #include "PlatformMouseEvent.h"
     29#include "KURL.h"
     30#include "PagePopupBlackBerryClient.h"
    3331#include "Settings.h"
    3432#include "WebPage.h"
     
    4240#define PADDING 80
    4341
    44 using namespace BlackBerry::Platform::Graphics;
    45 using namespace BlackBerry::WebKit;
    46 namespace WebCore {
     42using namespace WebCore;
    4743
    48 PagePopupBlackBerry::PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPage, PagePopupClient* client, const IntRect& rect)
     44namespace BlackBerry {
     45namespace WebKit {
     46
     47PagePopupBlackBerry::PagePopupBlackBerry(WebPagePrivate* webPage, PagePopupBlackBerryClient* client)
    4948    : m_webPagePrivate(webPage)
    5049    , m_client(adoptPtr(client))
    5150    , m_sharedClientPointer(adoptRef(new PagePopupBlackBerry::SharedClientPointer(client)))
    5251{
    53     m_rect = IntRect(rect.x(), rect.y(), client->contentSize().width(), client->contentSize().height());
    5452}
    5553
     
    5755{
    5856    ASSERT(!m_sharedClientPointer->get());
    59 }
    60 
    61 bool PagePopupBlackBerry::sendCreatePopupWebViewRequest()
    62 {
    63     return m_webPagePrivate->client()->createPopupWebView(m_rect);
    6457}
    6558
     
    188181
    189182    m_client->didClosePopup();
    190     m_webPagePrivate->client()->closePopupWebView();
    191     m_webPagePrivate->m_webPage->popupClosed();
    192183}
    193184
    194185}
    195 
     186}
  • trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h

    r128921 r150434  
    2121
    2222#include "IntRect.h"
    23 #include "PagePopup.h"
    2423#include <wtf/RefCounted.h>
    2524#include <wtf/RefPtr.h>
    2625
     26namespace WebCore {
     27class Frame;
     28}
    2729
    2830namespace BlackBerry {
     
    3032class WebPage;
    3133class WebPagePrivate;
    32 }
    33 }
     34class PagePopupBlackBerryClient;
    3435
    35 namespace WebCore {
    36 class Frame;
    37 class Page;
    38 class PagePopupClient;
    39 class PlatformMouseEvent;
    40 
    41 class PagePopupBlackBerry : public PagePopup {
     36class PagePopupBlackBerry {
    4237public:
    43     PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate*, PagePopupClient*, const IntRect&);
     38    PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate*, PagePopupBlackBerryClient*);
    4439    ~PagePopupBlackBerry();
    4540
    46     bool sendCreatePopupWebViewRequest();
    4741    bool init(BlackBerry::WebKit::WebPage*);
    4842    void closePopup();
    49     void setRect();
    5043
    5144    class SharedClientPointer : public RefCounted<SharedClientPointer> {
    5245    public:
    53         explicit SharedClientPointer(PagePopupClient* client) : m_client(client) { }
     46        explicit SharedClientPointer(PagePopupBlackBerryClient* client) : m_client(client) { }
    5447        void clear() { m_client = 0; }
    55         PagePopupClient* get() const { return m_client; }
     48        PagePopupBlackBerryClient* get() const { return m_client; }
    5649    private:
    57         PagePopupClient* m_client;
     50        PagePopupBlackBerryClient* m_client;
    5851    };
    5952
    6053private:
    6154    void generateHTML(BlackBerry::WebKit::WebPage*);
    62     void installDOMFunction(Frame*);
     55    void installDOMFunction(WebCore::Frame*);
    6356
    6457    BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate;
    65     OwnPtr<PagePopupClient> m_client;
     58    OwnPtr<PagePopupBlackBerryClient> m_client;
    6659    RefPtr<SharedClientPointer> m_sharedClientPointer;
    67     IntRect m_rect;
    6860};
    6961
    7062}
     63}
    7164
    7265#endif // PagePopupBlackBerry_h
  • trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp

    r150214 r150434  
    1818
    1919#include "config.h"
    20 
    2120#include "SelectPopupClient.h"
    2221
    23 #include "Chrome.h"
    24 #include "ChromeClient.h"
    25 #include "Document.h"
    26 #include "DocumentWriter.h"
    2722#include "HTMLOptionElement.h"
    2823#include "HTMLSelectElement.h"
    29 #include "NotImplemented.h"
    30 #include "Page.h"
    31 #include "PagePopup.h"
    3224#include "PopupPicker.h"
    3325#include "RenderObject.h"
     
    4133#define CELL_HEIGHT 30
    4234
    43 namespace WebCore {
     35using namespace WebCore;
     36
     37namespace BlackBerry {
     38namespace WebKit {
    4439
    4540DEFINE_STATIC_LOCAL(BlackBerry::Platform::LocalizeResource, s_resource, ());
     
    4742SelectPopupClient::SelectPopupClient(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds,
    4843    const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate* webPage, HTMLSelectElement* element)
    49     : m_multiple(multiple)
     44    : PagePopupBlackBerryClient(webPage)
     45    , m_multiple(multiple)
    5046    , m_size(size)
    51     , m_webPage(webPage)
    5247    , m_element(element)
    5348    , m_notifyChangeTimer(this, &SelectPopupClient::notifySelectionChange)
     
    5853SelectPopupClient::~SelectPopupClient()
    5954{
    60 }
    61 
    62 void SelectPopupClient::update(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds,
    63     const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate*, HTMLSelectElement* element)
    64 {
    65     m_multiple = multiple;
    66     m_size = size;
    67     m_element = element;
    68     generateHTML(multiple, size, labels, enableds, itemType, selecteds);
    6955}
    7056
     
    149135}
    150136
    151 void SelectPopupClient::closePopup()
    152 {
    153     ASSERT(m_webPage);
    154     m_webPage->m_page->chrome().client()->closePagePopup(0);
    155 }
    156 
    157 IntSize SelectPopupClient::contentSize()
    158 {
    159     // Fixme: will generate content size dynamically
    160     return IntSize(320, 256);
    161 }
    162 
    163 String SelectPopupClient::htmlSource()
    164 {
    165     return m_source;
    166 }
    167 
    168 Locale& SelectPopupClient::locale()
    169 {
    170     return m_element->document()->getCachedLocale();
    171 }
    172 
    173137void SelectPopupClient::setValueAndClosePopup(int, const String& stringValue)
    174138{
     
    210174}
    211175
    212 void SelectPopupClient::setValue(const String&)
    213 {
    214     notImplemented();
    215 }
    216 
    217176void SelectPopupClient::didClosePopup()
    218177{
    219     m_webPage = 0;
     178    PagePopupBlackBerryClient::didClosePopup();
    220179    m_element = 0;
    221 }
    222 
    223 void SelectPopupClient::writeDocument(DocumentWriter& writer)
    224 {
    225     writer.addData(m_source.utf8().data(), m_source.utf8().length());
    226180}
    227181
     
    234188
    235189}
    236 
     190}
  • trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h

    r143607 r150434  
    2121
    2222#include "IntSize.h"
    23 #include "PagePopupClient.h"
     23#include "PagePopupBlackBerryClient.h"
    2424#include "ScopePointer.h"
    2525#include "Timer.h"
    2626#include <wtf/text/WTFString.h>
     27
     28namespace WebCore {
     29class HTMLSelectElement;
     30}
    2731
    2832namespace BlackBerry {
     
    3236
    3337namespace WebKit {
    34 class WebPagePrivate;
    35 }
    36 }
    3738
    38 namespace WebCore {
    39 class DocumentWriter;
    40 class HTMLSelectElement;
    41 class PagePopup;
    42 
    43 class SelectPopupClient : public PagePopupClient {
     39class SelectPopupClient : public PagePopupBlackBerryClient {
    4440public:
    45     SelectPopupClient(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate*, HTMLSelectElement*);
     41    SelectPopupClient(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate*, WebCore::HTMLSelectElement*);
    4642    ~SelectPopupClient();
    4743
    48     void update(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate*, HTMLSelectElement*);
     44    virtual void setValueAndClosePopup(int, const String&);
     45    virtual void didClosePopup();
    4946
     47private:
    5048    void generateHTML(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds);
    5149    void notifySelectionChange(WebCore::Timer<SelectPopupClient> *);
    5250
    53     void writeDocument(DocumentWriter&);
    54     virtual IntSize contentSize();
    55     virtual String htmlSource();
    56     virtual Locale& locale();
    57     virtual void setValueAndClosePopup(int, const String&);
    58     virtual void setValue(const String&);
    59     virtual void closePopup();
    60     virtual void didClosePopup();
    61 
    6251    bool m_multiple;
    6352    unsigned m_size;
    64     String m_source;
    65     BlackBerry::WebKit::WebPagePrivate* m_webPage;
    66     RefPtr<HTMLSelectElement> m_element;
     53    RefPtr<WebCore::HTMLSelectElement> m_element;
    6754    WebCore::Timer<SelectPopupClient> m_notifyChangeTimer;
    6855};
    69 } // namespace WebCore
     56
     57}
     58}
    7059#endif
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r150214 r150434  
    12131213        element->document()->frame()->selection()->setCaretVisible(false);
    12141214
    1215         // Check if popup already exists, close it if does.
    1216         m_webPage->m_page->chrome().client()->closePagePopup(0);
    12171215        WTF::String value = element->value();
    12181216        WTF::String min = element->getAttribute(HTMLNames::minAttr).string();
     
    12211219
    12221220        DatePickerClient* client = new DatePickerClient(type, value, min, max, step,  m_webPage, element);
    1223         return m_webPage->m_page->chrome().client()->openPagePopup(client,  WebCore::IntRect());
     1221        return m_webPage->openPagePopup(client,  WebCore::IntRect());
    12241222        }
    12251223    default: // Other types not supported
     
    12391237    m_currentFocusElementType = TextPopup;
    12401238
    1241     // Check if popup already exists, close it if does.
    1242     m_webPage->m_page->chrome().client()->closePagePopup(0);
    1243 
    12441239    ColorPickerClient* client = new ColorPickerClient(element->value(), m_webPage, element);
    1245     return m_webPage->m_page->chrome().client()->openPagePopup(client, WebCore::IntRect());
     1240    return m_webPage->openPagePopup(client, WebCore::IntRect());
    12461241}
    12471242
     
    19711966    ScopeArray<BlackBerry::Platform::String> labels;
    19721967    labels.reset(new BlackBerry::Platform::String[size]);
    1973 
    1974     // Check if popup already exists, close it if does.
    1975     m_webPage->m_page->chrome().client()->closePagePopup(0);
    19761968
    19771969    bool* enableds = 0;
     
    20071999    WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(enclosingIntRect(select->getRect()));
    20082000    // Fail to create HTML popup, use the old path
    2009     if (!m_webPage->m_page->chrome().client()->openPagePopup(selectClient, elementRectInRootView))
     2001    if (!m_webPage->openPagePopup(selectClient, elementRectInRootView))
    20102002        m_webPage->m_client->openPopupList(multiple, size, labels, enableds, itemTypes, selecteds);
    20112003    delete[] enableds;
  • trunk/Source/cmake/OptionsBlackBerry.cmake

    r150336 r150434  
    182182WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS ON)
    183183WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ORIENTATION_EVENTS ON)
    184 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_POPUP ON)
    185184WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON)
    186185WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REPAINT_THROTTLING ON)
Note: See TracChangeset for help on using the changeset viewer.