Changeset 150434 in webkit
- Timestamp:
- May 21, 2013 3:55:57 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r150368 r150434 1 2013-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 1 11 2013-05-20 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 12 -
trunk/Source/WebKit/ChangeLog
r150336 r150434 1 2013-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 1 12 2013-05-18 Patrick Gansterer <paroga@webkit.org> 2 13 -
trunk/Source/WebKit/PlatformBlackBerry.cmake
r150336 r150434 103 103 blackberry/WebCoreSupport/NotificationClientBlackBerry.cpp 104 104 blackberry/WebCoreSupport/PagePopupBlackBerry.cpp 105 blackberry/WebCoreSupport/PagePopupBlackBerryClient.cpp 105 106 blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp 106 107 blackberry/WebCoreSupport/NavigatorContentUtilsClientBlackBerry.cpp -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r150274 r150434 102 102 #include "PageGroup.h" 103 103 #include "PagePopupBlackBerry.h" 104 #include "PagePopupBlackBerryClient.h" 104 105 #include "PlatformTouchEvent.h" 105 106 #include "PlatformWheelEvent.h" … … 464 465 cancelCallOnMainThread(handleServiceScriptedAnimationsOnMainThread, this); 465 466 #endif 467 468 closePagePopup(); 466 469 467 470 delete m_webSettings; … … 3150 3153 m_page->suspendScriptedAnimations(); 3151 3154 3152 if (m_webPage->hasOpenedPopup()) 3153 m_page->chrome().client()->closePagePopup(0); 3155 closePagePopup(); 3154 3156 } 3155 3157 … … 6067 6069 } 6068 6070 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; 6071 bool 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 6086 void 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 6097 bool WebPagePrivate::hasOpenedPopup() const 6098 { 6099 return m_selectPopup; 6089 6100 } 6090 6101 -
trunk/Source/WebKit/blackberry/Api/WebPage.h
r149769 r150434 37 37 class Frame; 38 38 class FrameLoaderClientBlackBerry; 39 class PagePopupBlackBerry;40 39 } 41 40 … … 63 62 class BackingStorePrivate; 64 63 class InRegionScroller; 64 class PagePopupBlackBerry; 65 65 class RenderQueue; 66 66 class WebCookieJar; … … 369 369 // Popup client 370 370 void initPopupWebView(BlackBerry::WebKit::WebPage*); 371 void popupOpened(WebCore::PagePopupBlackBerry* webPopup);372 void popupClosed();373 bool hasOpenedPopup() const;374 WebCore::PagePopupBlackBerry* popup();375 371 376 372 void autofillTextField(const BlackBerry::Platform::String&); … … 394 390 friend class WebKit::BackingStoreClient; 395 391 friend class WebKit::BackingStorePrivate; 392 friend class WebKit::PagePopupBlackBerry; 396 393 friend class WebKit::RenderQueue; 397 394 friend class WebKit::WebPageCompositor; … … 400 397 friend class WebCore::ChromeClientBlackBerry; 401 398 friend class WebCore::FrameLoaderClientBlackBerry; 402 friend class WebCore::PagePopupBlackBerry;403 399 WebPagePrivate* d; 404 400 }; -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r150091 r150434 69 69 class ScrollView; 70 70 class TransformationMatrix; 71 class PagePopupBlackBerry;72 71 template<typename T> class Timer; 73 72 } … … 81 80 class InPageSearchManager; 82 81 class InputHandler; 82 class PagePopupBlackBerry; 83 class PagePopupBlackBerryClient; 83 84 class SelectionHandler; 84 85 class TouchEventHandler; … … 413 414 BackingStoreClient* backingStoreClient() const; 414 415 415 void setParentPopup(WebCore::PagePopupBlackBerry* webPopup); 416 bool openPagePopup(PagePopupBlackBerryClient*, const WebCore::IntRect& originBoundsInRootView); 417 void closePagePopup(); 418 bool hasOpenedPopup() const; 416 419 417 420 // Clean up any document related data we might be holding. … … 636 639 637 640 // The popup that opened in this webpage 638 WebCore::PagePopupBlackBerry* m_selectPopup;641 PagePopupBlackBerry* m_selectPopup; 639 642 640 643 RefPtr<WebCore::AutofillManager> m_autofillManager; -
trunk/Source/WebKit/blackberry/ChangeLog
r150361 r150434 1 2013-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 1 73 2013-05-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 74 -
trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
r150071 r150434 48 48 #include "PageGroup.h" 49 49 #include "PageGroupLoadDeferrer.h" 50 #include "PagePopupBlackBerry.h"51 #include "PagePopupClient.h"52 50 #include "PopupMenuBlackBerry.h" 53 51 #include "RenderView.h" … … 151 149 void ChromeClientBlackBerry::chromeDestroyed() 152 150 { 153 // Destroy popup if we have.154 closePagePopup(0);155 151 delete this; 156 152 } … … 301 297 bool ChromeClientBlackBerry::hasOpenedPopup() const 302 298 { 303 return m_webPagePrivate-> m_webPage->hasOpenedPopup();299 return m_webPagePrivate->hasOpenedPopup(); 304 300 } 305 301 … … 312 308 { 313 309 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;337 310 } 338 311 -
trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
r150353 r150434 29 29 30 30 namespace WebCore { 31 class PagePopup;32 class PagePopupClient;33 31 34 32 class ChromeClientBlackBerry : public ChromeClient { … … 141 139 virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; 142 140 143 virtual WebCore::PagePopup* openPagePopup(WebCore::PagePopupClient*, const WebCore::IntRect&);144 virtual void closePagePopup(WebCore::PagePopup*);145 146 141 #if USE(ACCELERATED_COMPOSITING) 147 142 virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*); -
trunk/Source/WebKit/blackberry/WebCoreSupport/ColorPickerClient.cpp
r150214 r150434 20 20 #include "ColorPickerClient.h" 21 21 22 #include "Chrome.h"23 #include "ChromeClient.h"24 #include "Document.h"25 #include "DocumentWriter.h"26 22 #include "HTMLInputElement.h" 27 #include "NotImplemented.h"28 #include "Page.h"29 #include "PagePopup.h"30 23 #include "PopupPicker.h" 31 #include "RenderObject.h"32 24 #include "WebPage_p.h" 33 25 … … 37 29 #include <wtf/text/StringBuilder.h> 38 30 39 namespace WebCore { 31 using namespace WebCore; 32 33 namespace BlackBerry { 34 namespace WebKit { 40 35 41 36 DEFINE_STATIC_LOCAL(BlackBerry::Platform::LocalizeResource, s_resource, ()); 42 37 43 ColorPickerClient::ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate* webPage, HTMLInputElement* element)44 : m_webPage(webPage)38 ColorPickerClient::ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate* webPage, WebCore::HTMLInputElement* element) 39 : PagePopupBlackBerryClient(webPage) 45 40 , m_element(element) 46 41 { … … 85 80 } 86 81 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 dynamically96 return IntSize(320, 256);97 }98 99 String ColorPickerClient::htmlSource() const100 {101 return m_source;102 }103 104 Locale& ColorPickerClient::locale()105 {106 return m_element->document()->getCachedLocale();107 }108 109 82 void ColorPickerClient::setValueAndClosePopup(int, const String& value) 110 83 { … … 117 90 } 118 91 119 void ColorPickerClient::setValue(const String&)120 {121 notImplemented();122 }123 124 92 void ColorPickerClient::didClosePopup() 125 93 { 126 m_webPage = 0;94 PagePopupBlackBerryClient::didClosePopup(); 127 95 m_element = 0; 128 96 } 129 97 130 void ColorPickerClient::writeDocument(DocumentWriter& writer)131 {132 CString sourceString = m_source.utf8();133 writer.addData(sourceString.data(), sourceString.length());134 98 } 135 99 } -
trunk/Source/WebKit/blackberry/WebCoreSupport/ColorPickerClient.h
r143607 r150434 20 20 #define ColorPickerClient_h 21 21 22 #include "PagePopup Client.h"22 #include "PagePopupBlackBerryClient.h" 23 23 #include <BlackBerryPlatformInputEvents.h> 24 25 namespace WebCore { 26 class HTMLInputElement; 27 } 24 28 25 29 namespace BlackBerry { … … 29 33 30 34 namespace WebKit { 31 class WebPagePrivate;32 }33 }34 35 35 namespace WebCore{36 class DocumentWriter; 37 class HTMLInputElement;36 class ColorPickerClient : public PagePopupBlackBerryClient { 37 public: 38 ColorPickerClient(const BlackBerry::Platform::String& value, BlackBerry::WebKit::WebPagePrivate*, WebCore::HTMLInputElement*); 38 39 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();48 40 void setValueAndClosePopup(int, const String&); 49 void setValue(const String&);50 void closePopup();51 41 void didClosePopup(); 52 42 53 43 private: 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; 57 47 }; 58 } // namespace WebCore 48 49 } 50 } 59 51 #endif -
trunk/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
r150214 r150434 20 20 #include "DatePickerClient.h" 21 21 22 #include "Chrome.h"23 #include "ChromeClient.h"24 22 #include "Document.h" 25 #include "DocumentWriter.h"26 23 #include "Frame.h" 27 24 #include "HTMLInputElement.h" 28 #include "NotImplemented.h"29 #include "Page.h"30 #include "PagePopup.h"31 25 #include "PopupPicker.h" 32 #include "RenderObject.h"33 26 #include "WebPage_p.h" 34 27 … … 39 32 #include <wtf/text/StringBuilder.h> 40 33 34 using namespace WebCore; 41 35 using namespace icu; 42 36 43 namespace WebCore { 37 namespace BlackBerry { 38 namespace WebKit { 44 39 45 40 DEFINE_STATIC_LOCAL(BlackBerry::Platform::LocalizeResource, s_resource, ()); 46 41 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)42 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, WebCore::HTMLInputElement* element) 43 : PagePopupBlackBerryClient(webPage) 44 , m_type(type) 50 45 , m_element(element) 51 46 { … … 139 134 } 140 135 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 dynamically150 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 163 136 void DatePickerClient::setValueAndClosePopup(int, const String& value) 164 137 { … … 174 147 } 175 148 176 void DatePickerClient::setValue(const String&)177 {178 notImplemented();179 }180 181 149 void DatePickerClient::didClosePopup() 182 150 { 183 m_webPage = 0;151 PagePopupBlackBerryClient::didClosePopup(); 184 152 m_element = 0; 185 }186 187 void DatePickerClient::writeDocument(DocumentWriter& writer)188 {189 writer.addData(m_source.utf8().data(), m_source.utf8().length());190 153 } 191 154 … … 240 203 return printedLabels.toString(); 241 204 } 242 } 205 206 } 207 } -
trunk/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.h
r149814 r150434 20 20 #define DatePickerClient_h 21 21 22 #include "PagePopup Client.h"22 #include "PagePopupBlackBerryClient.h" 23 23 #include <BlackBerryPlatformInputEvents.h> 24 24 #include <unicode/udat.h> 25 26 namespace WebCore { 27 class HTMLInputElement; 28 } 25 29 26 30 namespace BlackBerry { … … 31 35 namespace WebKit { 32 36 class WebPagePrivate; 33 }34 }35 37 36 namespace WebCore { 37 class DocumentWriter; 38 class HTMLInputElement; 39 40 class DatePickerClient : public PagePopupClient { 38 class DatePickerClient : public PagePopupBlackBerryClient { 41 39 public: 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*); 43 41 ~DatePickerClient(); 44 42 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();51 43 void setValueAndClosePopup(int, const String&); 52 void setValue(const String&);53 44 void didClosePopup(); 54 void closePopup();55 45 56 46 private: 47 void generateHTML(BlackBerry::Platform::BlackBerryInputType, const BlackBerry::Platform::String& value, const BlackBerry::Platform::String& min, const BlackBerry::Platform::String& max, double step); 57 48 static const String generateDateLabels(UDateFormatSymbolType); 58 49 59 50 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; 63 52 }; 64 } // namespace WebCore 53 54 } 55 } 65 56 #endif -
trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
r149815 r150434 17 17 */ 18 18 #include "config.h" 19 20 19 #include "PagePopupBlackBerry.h" 21 20 22 21 #include "DocumentLoader.h" 22 #include "DocumentWriter.h" 23 23 #include "EmptyClients.h" 24 24 #include "FrameView.h" … … 27 27 #include "JSObject.h" 28 28 #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" 33 31 #include "Settings.h" 34 32 #include "WebPage.h" … … 42 40 #define PADDING 80 43 41 44 using namespace BlackBerry::Platform::Graphics; 45 using namespace BlackBerry::WebKit; 46 namespace WebCore { 42 using namespace WebCore; 47 43 48 PagePopupBlackBerry::PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPage, PagePopupClient* client, const IntRect& rect) 44 namespace BlackBerry { 45 namespace WebKit { 46 47 PagePopupBlackBerry::PagePopupBlackBerry(WebPagePrivate* webPage, PagePopupBlackBerryClient* client) 49 48 : m_webPagePrivate(webPage) 50 49 , m_client(adoptPtr(client)) 51 50 , m_sharedClientPointer(adoptRef(new PagePopupBlackBerry::SharedClientPointer(client))) 52 51 { 53 m_rect = IntRect(rect.x(), rect.y(), client->contentSize().width(), client->contentSize().height());54 52 } 55 53 … … 57 55 { 58 56 ASSERT(!m_sharedClientPointer->get()); 59 }60 61 bool PagePopupBlackBerry::sendCreatePopupWebViewRequest()62 {63 return m_webPagePrivate->client()->createPopupWebView(m_rect);64 57 } 65 58 … … 188 181 189 182 m_client->didClosePopup(); 190 m_webPagePrivate->client()->closePopupWebView();191 m_webPagePrivate->m_webPage->popupClosed();192 183 } 193 184 194 185 } 195 186 } -
trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.h
r128921 r150434 21 21 22 22 #include "IntRect.h" 23 #include "PagePopup.h"24 23 #include <wtf/RefCounted.h> 25 24 #include <wtf/RefPtr.h> 26 25 26 namespace WebCore { 27 class Frame; 28 } 27 29 28 30 namespace BlackBerry { … … 30 32 class WebPage; 31 33 class WebPagePrivate; 32 } 33 } 34 class PagePopupBlackBerryClient; 34 35 35 namespace WebCore { 36 class Frame; 37 class Page; 38 class PagePopupClient; 39 class PlatformMouseEvent; 40 41 class PagePopupBlackBerry : public PagePopup { 36 class PagePopupBlackBerry { 42 37 public: 43 PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate*, PagePopup Client*, const IntRect&);38 PagePopupBlackBerry(BlackBerry::WebKit::WebPagePrivate*, PagePopupBlackBerryClient*); 44 39 ~PagePopupBlackBerry(); 45 40 46 bool sendCreatePopupWebViewRequest();47 41 bool init(BlackBerry::WebKit::WebPage*); 48 42 void closePopup(); 49 void setRect();50 43 51 44 class SharedClientPointer : public RefCounted<SharedClientPointer> { 52 45 public: 53 explicit SharedClientPointer(PagePopup Client* client) : m_client(client) { }46 explicit SharedClientPointer(PagePopupBlackBerryClient* client) : m_client(client) { } 54 47 void clear() { m_client = 0; } 55 PagePopup Client* get() const { return m_client; }48 PagePopupBlackBerryClient* get() const { return m_client; } 56 49 private: 57 PagePopup Client* m_client;50 PagePopupBlackBerryClient* m_client; 58 51 }; 59 52 60 53 private: 61 54 void generateHTML(BlackBerry::WebKit::WebPage*); 62 void installDOMFunction( Frame*);55 void installDOMFunction(WebCore::Frame*); 63 56 64 57 BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate; 65 OwnPtr<PagePopup Client> m_client;58 OwnPtr<PagePopupBlackBerryClient> m_client; 66 59 RefPtr<SharedClientPointer> m_sharedClientPointer; 67 IntRect m_rect;68 60 }; 69 61 70 62 } 63 } 71 64 72 65 #endif // PagePopupBlackBerry_h -
trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
r150214 r150434 18 18 19 19 #include "config.h" 20 21 20 #include "SelectPopupClient.h" 22 21 23 #include "Chrome.h"24 #include "ChromeClient.h"25 #include "Document.h"26 #include "DocumentWriter.h"27 22 #include "HTMLOptionElement.h" 28 23 #include "HTMLSelectElement.h" 29 #include "NotImplemented.h"30 #include "Page.h"31 #include "PagePopup.h"32 24 #include "PopupPicker.h" 33 25 #include "RenderObject.h" … … 41 33 #define CELL_HEIGHT 30 42 34 43 namespace WebCore { 35 using namespace WebCore; 36 37 namespace BlackBerry { 38 namespace WebKit { 44 39 45 40 DEFINE_STATIC_LOCAL(BlackBerry::Platform::LocalizeResource, s_resource, ()); … … 47 42 SelectPopupClient::SelectPopupClient(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, 48 43 const int* itemType, bool* selecteds, BlackBerry::WebKit::WebPagePrivate* webPage, HTMLSelectElement* element) 49 : m_multiple(multiple) 44 : PagePopupBlackBerryClient(webPage) 45 , m_multiple(multiple) 50 46 , m_size(size) 51 , m_webPage(webPage)52 47 , m_element(element) 53 48 , m_notifyChangeTimer(this, &SelectPopupClient::notifySelectionChange) … … 58 53 SelectPopupClient::~SelectPopupClient() 59 54 { 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);69 55 } 70 56 … … 149 135 } 150 136 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 dynamically160 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 173 137 void SelectPopupClient::setValueAndClosePopup(int, const String& stringValue) 174 138 { … … 210 174 } 211 175 212 void SelectPopupClient::setValue(const String&)213 {214 notImplemented();215 }216 217 176 void SelectPopupClient::didClosePopup() 218 177 { 219 m_webPage = 0;178 PagePopupBlackBerryClient::didClosePopup(); 220 179 m_element = 0; 221 }222 223 void SelectPopupClient::writeDocument(DocumentWriter& writer)224 {225 writer.addData(m_source.utf8().data(), m_source.utf8().length());226 180 } 227 181 … … 234 188 235 189 } 236 190 } -
trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h
r143607 r150434 21 21 22 22 #include "IntSize.h" 23 #include "PagePopup Client.h"23 #include "PagePopupBlackBerryClient.h" 24 24 #include "ScopePointer.h" 25 25 #include "Timer.h" 26 26 #include <wtf/text/WTFString.h> 27 28 namespace WebCore { 29 class HTMLSelectElement; 30 } 27 31 28 32 namespace BlackBerry { … … 32 36 33 37 namespace WebKit { 34 class WebPagePrivate;35 }36 }37 38 38 namespace WebCore { 39 class DocumentWriter; 40 class HTMLSelectElement; 41 class PagePopup; 42 43 class SelectPopupClient : public PagePopupClient { 39 class SelectPopupClient : public PagePopupBlackBerryClient { 44 40 public: 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*); 46 42 ~SelectPopupClient(); 47 43 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(); 49 46 47 private: 50 48 void generateHTML(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, bool* enableds, const int* itemType, bool* selecteds); 51 49 void notifySelectionChange(WebCore::Timer<SelectPopupClient> *); 52 50 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 62 51 bool m_multiple; 63 52 unsigned m_size; 64 String m_source; 65 BlackBerry::WebKit::WebPagePrivate* m_webPage; 66 RefPtr<HTMLSelectElement> m_element; 53 RefPtr<WebCore::HTMLSelectElement> m_element; 67 54 WebCore::Timer<SelectPopupClient> m_notifyChangeTimer; 68 55 }; 69 } // namespace WebCore 56 57 } 58 } 70 59 #endif -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
r150214 r150434 1213 1213 element->document()->frame()->selection()->setCaretVisible(false); 1214 1214 1215 // Check if popup already exists, close it if does.1216 m_webPage->m_page->chrome().client()->closePagePopup(0);1217 1215 WTF::String value = element->value(); 1218 1216 WTF::String min = element->getAttribute(HTMLNames::minAttr).string(); … … 1221 1219 1222 1220 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()); 1224 1222 } 1225 1223 default: // Other types not supported … … 1239 1237 m_currentFocusElementType = TextPopup; 1240 1238 1241 // Check if popup already exists, close it if does.1242 m_webPage->m_page->chrome().client()->closePagePopup(0);1243 1244 1239 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()); 1246 1241 } 1247 1242 … … 1971 1966 ScopeArray<BlackBerry::Platform::String> labels; 1972 1967 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);1976 1968 1977 1969 bool* enableds = 0; … … 2007 1999 WebCore::IntRect elementRectInRootView = select->document()->view()->contentsToRootView(enclosingIntRect(select->getRect())); 2008 2000 // 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)) 2010 2002 m_webPage->m_client->openPopupList(multiple, size, labels, enableds, itemTypes, selecteds); 2011 2003 delete[] enableds; -
trunk/Source/cmake/OptionsBlackBerry.cmake
r150336 r150434 182 182 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS ON) 183 183 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ORIENTATION_EVENTS ON) 184 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_POPUP ON)185 184 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON) 186 185 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REPAINT_THROTTLING ON)
Note: See TracChangeset
for help on using the changeset viewer.