PagePopupClient.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2013 Research In Motion Limited. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include "config.h"
  19. #include "PagePopupClient.h"
  20. #include "DocumentWriter.h"
  21. #include "IntRect.h"
  22. #include "WebPage_p.h"
  23. #include <BlackBerryPlatformString.h>
  24. using namespace WebCore;
  25. namespace BlackBerry {
  26. namespace WebKit {
  27. PagePopupClient::PagePopupClient(WebPagePrivate* webPagePrivate)
  28. : m_webPagePrivate(webPagePrivate)
  29. {
  30. }
  31. void PagePopupClient::closePopup()
  32. {
  33. ASSERT(m_webPagePrivate);
  34. m_webPagePrivate->closePagePopup();
  35. }
  36. void PagePopupClient::didClosePopup()
  37. {
  38. m_webPagePrivate = 0;
  39. }
  40. IntSize PagePopupClient::contentSize()
  41. {
  42. // FIXME: will generate content size dynamically.
  43. return IntSize(320, 256);
  44. }
  45. void PagePopupClient::writeDocument(DocumentWriter& writer)
  46. {
  47. writer.addData(m_source.utf8().data(), m_source.utf8().length());
  48. }
  49. }
  50. }