Changeset 55981 in webkit
- Timestamp:
- Mar 14, 2010 6:28:02 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55980 r55981 1 2010-03-14 Chang Shu <chang.shu@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] [Symbian] Added block for ENABLE_SYMBIAN_DIALOG_PROVIDERS 6 on Symbian platform. 7 https://bugs.webkit.org/show_bug.cgi?id=35919 8 9 * WebCore.pro: 10 1 11 2010-03-14 Yael Aharon <yael.aharon@nokia.com> 2 12 -
trunk/WebCore/WebCore.pro
r55980 r55981 2808 2808 } 2809 2809 2810 contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) { 2811 # this feature requires the S60 platform private BrowserDialogsProvider.h header file 2812 # and is therefore not enabled by default but only meant for platform builds. 2813 symbian { 2814 LIBS += -lbrowserdialogsprovider 2815 } 2816 } 2810 2817 2811 2818 include($$PWD/../WebKit/qt/Api/headers.pri) -
trunk/WebKit/qt/ChangeLog
r55978 r55981 1 2010-03-14 Chang Shu <chang.shu@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] [Symbian] Use Symbian native dialog providers for combo pupups. 6 https://bugs.webkit.org/show_bug.cgi?id=35919 7 8 * WebCoreSupport/QtFallbackWebPopup.cpp: 9 (WebCore::QtFallbackWebPopup::show): 10 (WebCore::ResetAndDestroy): 11 (WebCore::QtFallbackWebPopup::showS60BrowserDialog): 12 * WebCoreSupport/QtFallbackWebPopup.h: 13 1 14 2010-03-14 Antti Koivisto <koivisto@iki.fi> 2 15 -
trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
r54241 r55981 24 24 #include "HostWindow.h" 25 25 #include "PopupMenuClient.h" 26 #include "QWebPageClient.h" 26 27 #include "qgraphicswebview.h" 27 #include "QWebPageClient.h"28 28 #include <QAbstractItemView> 29 29 #include <QApplication> … … 35 35 #include <QStandardItemModel> 36 36 37 #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) 38 #include <BrCtlDialogsProvider.h> 39 #include <BrowserDialogsProvider.h> // S60 platform private header file 40 #include <e32base.h> 41 #endif 42 37 43 namespace WebCore { 38 44 … … 94 100 void QtFallbackWebPopup::show() 95 101 { 102 #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) 103 TRAP_IGNORE(showS60BrowserDialog()); 104 #else 96 105 populate(); 97 106 m_combo->setCurrentIndex(currentIndex()); … … 125 134 Qt::LeftButton, Qt::NoModifier); 126 135 QCoreApplication::sendEvent(m_combo, &event); 127 } 136 #endif 137 } 138 139 #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) 140 141 static void ResetAndDestroy(TAny* aPtr) 142 { 143 RPointerArray<HBufC>* items = reinterpret_cast<RPointerArray<HBufC>* >(aPtr); 144 items->ResetAndDestroy(); 145 } 146 147 void QtFallbackWebPopup::showS60BrowserDialog() 148 { 149 static MBrCtlDialogsProvider* dialogs = CBrowserDialogsProvider::NewL(0); 150 if (!dialogs) 151 return; 152 153 int size = itemCount(); 154 CArrayFix<TBrCtlSelectOptionData>* options = new CArrayFixFlat<TBrCtlSelectOptionData>(qMax(1, size)); 155 RPointerArray<HBufC> items(qMax(1, size)); 156 CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &items)); 157 158 for (int i = 0; i < size; i++) { 159 if (itemType(i) == Separator) { 160 TBrCtlSelectOptionData data(_L("----------"), false, false, false); 161 options->AppendL(data); 162 } else { 163 HBufC16* itemStr = HBufC16::NewL(itemText(i).length()); 164 itemStr->Des().Copy((const TUint16*)itemText(i).utf16(), itemText(i).length()); 165 CleanupStack::PushL(itemStr); 166 TBrCtlSelectOptionData data(*itemStr, i == currentIndex(), false, itemIsEnabled(i)); 167 options->AppendL(data); 168 items.AppendL(itemStr); 169 CleanupStack::Pop(); 170 } 171 } 172 173 dialogs->DialogSelectOptionL(KNullDesC(), (TBrCtlSelectOptionType)(ESelectTypeSingle | ESelectTypeWithFindPane), *options); 174 175 CleanupStack::PopAndDestroy(&items); 176 177 int newIndex; 178 for (newIndex = 0; newIndex < options->Count() && !options->At(newIndex).IsSelected(); newIndex++) {} 179 if (newIndex == options->Count()) 180 newIndex = currentIndex(); 181 182 m_popupVisible = false; 183 popupDidHide(); 184 185 if (currentIndex() != newIndex && newIndex >= 0) 186 valueChanged(newIndex); 187 188 delete options; 189 } 190 #endif 128 191 129 192 void QtFallbackWebPopup::hide() -
trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
r53769 r55981 49 49 50 50 void populate(); 51 #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) 52 void showS60BrowserDialog(); 53 #endif 51 54 }; 52 55
Note: See TracChangeset
for help on using the changeset viewer.