/src/3rdparty/webkit/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp

https://bitbucket.org/ultra_iter/qt-vtl · C++ · 403 lines · 306 code · 74 blank · 23 comment · 2 complexity · fa4b3959ef55a1b7f8a15780d76a11b9 MD5 · raw file

  1. /*
  2. * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  16. * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  17. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  18. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  19. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. #include "config.h"
  25. #include "ChromeClientWinCE.h"
  26. #include "FileChooser.h"
  27. #include "Icon.h"
  28. #include "NotImplemented.h"
  29. #include "NavigationAction.h"
  30. #include "PopupMenuWin.h"
  31. #include "SearchPopupMenuWin.h"
  32. #include "WebView.h"
  33. #include <wtf/text/CString.h>
  34. using namespace WebCore;
  35. namespace WebKit {
  36. ChromeClientWinCE::ChromeClientWinCE(WebView* webView)
  37. : m_webView(webView)
  38. {
  39. ASSERT(m_webView);
  40. }
  41. void ChromeClientWinCE::chromeDestroyed()
  42. {
  43. delete this;
  44. }
  45. FloatRect ChromeClientWinCE::windowRect()
  46. {
  47. if (!m_webView)
  48. return FloatRect();
  49. RECT rect;
  50. m_webView->frameRect(&rect);
  51. return rect;
  52. }
  53. void ChromeClientWinCE::setWindowRect(const FloatRect&)
  54. {
  55. notImplemented();
  56. }
  57. FloatRect ChromeClientWinCE::pageRect()
  58. {
  59. return windowRect();
  60. }
  61. float ChromeClientWinCE::scaleFactor()
  62. {
  63. return 1.0;
  64. }
  65. void ChromeClientWinCE::focus()
  66. {
  67. notImplemented();
  68. }
  69. void ChromeClientWinCE::unfocus()
  70. {
  71. notImplemented();
  72. }
  73. Page* ChromeClientWinCE::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&)
  74. {
  75. notImplemented();
  76. return 0;
  77. }
  78. void ChromeClientWinCE::show()
  79. {
  80. notImplemented();
  81. }
  82. bool ChromeClientWinCE::canRunModal()
  83. {
  84. notImplemented();
  85. return false;
  86. }
  87. void ChromeClientWinCE::runModal()
  88. {
  89. notImplemented();
  90. }
  91. void ChromeClientWinCE::setToolbarsVisible(bool)
  92. {
  93. notImplemented();
  94. }
  95. bool ChromeClientWinCE::toolbarsVisible()
  96. {
  97. return false;
  98. }
  99. void ChromeClientWinCE::setStatusbarVisible(bool)
  100. {
  101. notImplemented();
  102. }
  103. bool ChromeClientWinCE::statusbarVisible()
  104. {
  105. notImplemented();
  106. return false;
  107. }
  108. void ChromeClientWinCE::setScrollbarsVisible(bool)
  109. {
  110. notImplemented();
  111. }
  112. bool ChromeClientWinCE::scrollbarsVisible()
  113. {
  114. notImplemented();
  115. return false;
  116. }
  117. void ChromeClientWinCE::setMenubarVisible(bool)
  118. {
  119. notImplemented();
  120. }
  121. bool ChromeClientWinCE::menubarVisible()
  122. {
  123. notImplemented();
  124. return false;
  125. }
  126. void ChromeClientWinCE::setResizable(bool)
  127. {
  128. notImplemented();
  129. }
  130. void ChromeClientWinCE::closeWindowSoon()
  131. {
  132. PostMessageW(m_webView->windowHandle(), WM_CLOSE, 0, 0);
  133. }
  134. bool ChromeClientWinCE::canTakeFocus(FocusDirection)
  135. {
  136. return true;
  137. }
  138. void ChromeClientWinCE::takeFocus(FocusDirection)
  139. {
  140. unfocus();
  141. }
  142. void ChromeClientWinCE::focusedNodeChanged(Node*)
  143. {
  144. notImplemented();
  145. }
  146. void ChromeClientWinCE::focusedFrameChanged(Frame*)
  147. {
  148. }
  149. bool ChromeClientWinCE::canRunBeforeUnloadConfirmPanel()
  150. {
  151. return true;
  152. }
  153. bool ChromeClientWinCE::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
  154. {
  155. return runJavaScriptConfirm(frame, message);
  156. }
  157. void ChromeClientWinCE::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, unsigned int, const String&)
  158. {
  159. notImplemented();
  160. }
  161. void ChromeClientWinCE::runJavaScriptAlert(Frame*, const String& message)
  162. {
  163. m_webView->runJavaScriptAlert(message);
  164. }
  165. bool ChromeClientWinCE::runJavaScriptConfirm(Frame*, const String& message)
  166. {
  167. return m_webView->runJavaScriptConfirm(message);
  168. }
  169. bool ChromeClientWinCE::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
  170. {
  171. return m_webView->runJavaScriptPrompt(message, defaultValue, result);
  172. }
  173. void ChromeClientWinCE::setStatusbarText(const String&)
  174. {
  175. notImplemented();
  176. }
  177. bool ChromeClientWinCE::shouldInterruptJavaScript()
  178. {
  179. notImplemented();
  180. return false;
  181. }
  182. KeyboardUIMode ChromeClientWinCE::keyboardUIMode()
  183. {
  184. return KeyboardAccessTabsToLinks;
  185. }
  186. IntRect ChromeClientWinCE::windowResizerRect() const
  187. {
  188. notImplemented();
  189. return IntRect();
  190. }
  191. void ChromeClientWinCE::invalidateWindow(const IntRect&, bool)
  192. {
  193. notImplemented();
  194. }
  195. void ChromeClientWinCE::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
  196. {
  197. RECT rect = updateRect;
  198. InvalidateRect(m_webView->windowHandle(), &rect, FALSE);
  199. if (immediate)
  200. UpdateWindow(m_webView->windowHandle());
  201. }
  202. void ChromeClientWinCE::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
  203. {
  204. invalidateContentsAndWindow(updateRect, immediate);
  205. }
  206. void ChromeClientWinCE::scroll(const IntSize&, const IntRect& rectToScroll, const IntRect&)
  207. {
  208. invalidateContentsAndWindow(rectToScroll, false);
  209. }
  210. IntRect ChromeClientWinCE::windowToScreen(const IntRect& rect) const
  211. {
  212. notImplemented();
  213. return rect;
  214. }
  215. IntPoint ChromeClientWinCE::screenToWindow(const IntPoint& point) const
  216. {
  217. notImplemented();
  218. return point;
  219. }
  220. PlatformPageClient ChromeClientWinCE::platformPageClient() const
  221. {
  222. notImplemented();
  223. return 0;
  224. }
  225. void ChromeClientWinCE::contentsSizeChanged(Frame*, const IntSize&) const
  226. {
  227. notImplemented();
  228. }
  229. void ChromeClientWinCE::scrollRectIntoView(const IntRect&, const ScrollView*) const
  230. {
  231. notImplemented();
  232. }
  233. void ChromeClientWinCE::scrollbarsModeDidChange() const
  234. {
  235. notImplemented();
  236. }
  237. void ChromeClientWinCE::mouseDidMoveOverElement(const HitTestResult&, unsigned)
  238. {
  239. notImplemented();
  240. }
  241. void ChromeClientWinCE::setToolTip(const String&, TextDirection)
  242. {
  243. notImplemented();
  244. }
  245. void ChromeClientWinCE::print(Frame*)
  246. {
  247. notImplemented();
  248. }
  249. #if ENABLE(DATABASE)
  250. void ChromeClientWinCE::exceededDatabaseQuota(Frame*, const String&)
  251. {
  252. notImplemented();
  253. }
  254. #endif
  255. #if ENABLE(OFFLINE_WEB_APPLICATIONS)
  256. void ChromeClientWinCE::reachedMaxAppCacheSize(int64_t)
  257. {
  258. notImplemented();
  259. }
  260. void ChromeClientWinCE::reachedApplicationCacheOriginQuota(SecurityOrigin*)
  261. {
  262. notImplemented();
  263. }
  264. #endif
  265. #if ENABLE(TOUCH_EVENTS)
  266. void ChromeClientWinCE::needTouchEvents(bool)
  267. {
  268. notImplemented();
  269. }
  270. #endif
  271. #if USE(ACCELERATED_COMPOSITING)
  272. void ChromeClientWinCE::attachRootGraphicsLayer(Frame*, GraphicsLayer*)
  273. {
  274. notImplemented();
  275. }
  276. void ChromeClientWinCE::setNeedsOneShotDrawingSynchronization()
  277. {
  278. notImplemented();
  279. }
  280. void ChromeClientWinCE::scheduleCompositingLayerSync()
  281. {
  282. notImplemented();
  283. }
  284. #endif
  285. void ChromeClientWinCE::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
  286. {
  287. notImplemented();
  288. }
  289. void ChromeClientWinCE::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
  290. {
  291. chooser->iconLoaded(Icon::createIconForFiles(filenames));
  292. }
  293. void ChromeClientWinCE::setCursor(const Cursor&)
  294. {
  295. notImplemented();
  296. }
  297. void ChromeClientWinCE::setLastSetCursorToCurrentCursor()
  298. {
  299. notImplemented();
  300. }
  301. void ChromeClientWinCE::formStateDidChange(const Node*)
  302. {
  303. notImplemented();
  304. }
  305. void ChromeClientWinCE::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
  306. {
  307. notImplemented();
  308. }
  309. void ChromeClientWinCE::cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*)
  310. {
  311. notImplemented();
  312. }
  313. bool ChromeClientWinCE::selectItemWritingDirectionIsNatural()
  314. {
  315. return false;
  316. }
  317. bool ChromeClientWinCE::selectItemAlignmentFollowsMenuWritingDirection()
  318. {
  319. return false;
  320. }
  321. PassRefPtr<PopupMenu> ChromeClientWinCE::createPopupMenu(PopupMenuClient* client) const
  322. {
  323. return adoptRef(new PopupMenuWin(client));
  324. }
  325. PassRefPtr<SearchPopupMenu> ChromeClientWinCE::createSearchPopupMenu(PopupMenuClient* client) const
  326. {
  327. return adoptRef(new SearchPopupMenuWin(client));
  328. }
  329. } // namespace WebKit