1. Feb 13, 2014
  2. Feb 12, 2014
  3. Jan 30, 2014
  4. Jan 22, 2014
    • Jocelyn Turcotte's avatar
      Clear callbacks with an empty value on page destruction · 6fb392ee
      Jocelyn Turcotte authored
      
      The current implementation offers no way to cancel async requests.
      This means that normal applications could easily allow callbacks
      to dereference a destroyed object unless they use a smart pointer
      within the callback function object.
      
      This patch will empty the pending callback list by calling each of
      them with an empty value. This will at least allow applications to
      cover the cases where the page is expected to have a shorter or equal
      lifetime than objects referenced in the callback.
      
      Change-Id: Ia9fc556b03f5d83f904a0ff4b05dc9e440ea488c
      Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
      6fb392ee
    • Jocelyn Turcotte's avatar
      Implement QWebEnginePage::toHtml and toPlainText · 1fcd7970
      Jocelyn Turcotte authored
      
      Those methods are now made asynchronous and need to be given a
      callback to handle the result.
      
      Update the code in the browser and fancybrowser examples using
      std::bind when using C++11 or tr1::bind with C++03 (which should be
      available with compilers on platforms that we support).
      
      Add a (currently failing) earlyToHtml test to make sure that an empty
      page doesn't crash because of a possibly incomplete attachment of
      the QtRenderViewObserver.
      
      Change-Id: I3ab7cb6f25b91b584dd80df5e4e9ad1e3214348e
      Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
      1fcd7970
    • Jocelyn Turcotte's avatar
      Refactor the callback mechanism used by runJavaScript · 6d760436
      Jocelyn Turcotte authored
      
      This prepares the way for other API made async like toHtml and
      toPlainText.
      
      Use a callback class with an implicit templated constructor to carry
      the functor across the API boundary and avoid the intermediate helper
      method as the ABI that we have to maintain.
      
      Also pass the callback result through WebContentsAdapterClient using
      a bookkeeping ID instead of transferring the callback to
      WebContentsAdapter. This will allow other calls, which might not
      already allow passing a callback functor, to use a consisten way
      of carrying back the result to the top API layer.
      
      Change-Id: Ia923767b9c1021a108c26da17d4c41878ef7cb95
      Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
      6d760436
    • Jocelyn Turcotte's avatar
      Implement QWebEnginePage::setHtml and setContent · e6b846f3
      Jocelyn Turcotte authored
      
      Load a generated data: URL to carry the data.
      
      This is not as efficient as it could be but the behavior matches and
      this should be fine for now.
      
      Change-Id: I26ad2e5976025a3044fb03f066074ce6dd34e575
      Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
      e6b846f3
  5. Jan 17, 2014
  6. Jan 15, 2014
  7. Dec 04, 2013
    • Arvid Nilsson's avatar
      Quick: Add experimental.viewport.devicePixelRatio · 5d66b66d
      Arvid Nilsson authored
      
      This specifies a devicePixelRatio to be used by web content instead of
      the QScreen::devicePixelRatio(). This is necessary on non-iOS mobile
      devices to remain compatible with the mobile web which assumes
      devicePixelRatio is computed as the ratio of actual dpi to 160 dpi.
      Non-iOS mobile platforms may use different criteria to determine the
      QScreen::devicePixelRatio(), depending on the history of the platform,
      or simply leave it at 1.0.
      
      For QNX, this setting gets a reasonable default value so developers
      don't have to regularly use this experimental API.
      
      These changes were inspired by the Android Chromium port which uses a
      GetDpiScale() to accomplish the same in
      content/browser/android/content_view_core_impl.cc.
      
      Change-Id: I1bc8878a47dabcdb6986c4fe5c8c4ac230ae2514
      Reviewed-by: default avatarJocelyn Turcotte <jocelyn.turcotte@digia.com>
      5d66b66d
  8. Nov 28, 2013
    • Jocelyn Turcotte's avatar
      Moving sources to src part 1: Move files. · fd61d752
      Jocelyn Turcotte authored
      This only move files without adjusting any paths.
      
      This moves:
      - lib/quick -> src/webengine/api (API files)
        lib/quick -> src/webengine (other files)
        This contains the main QtWebEngine module library since
        <ec7b2ee7
      
      >.
      - lib/widgets -> src/webenginewidgets
        Also rename this directory to match its module name and rename Api to api.
      - lib -> src/core
      - process -> src/process
      - resources -> src/core/resources
      - tools/* -> tools/scripts/
      
      The build directory is spread as follow:
      - build/build.pro -> src/core/gyp_run.pro
      - build/qmake_extras/* -> src/core/ (for the host and target .pro files)
      - build/qmake -> tools/qmake
      - Build related scripts -> tools/buildscripts
      
      Change-Id: I0cded1de772c99c0c1da6536c9afea353236b4a1
      Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
      Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
      Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
      fd61d752
  9. Nov 26, 2013
  10. Nov 15, 2013
  11. Nov 13, 2013
  12. Nov 06, 2013
    • Jocelyn Turcotte's avatar
      Make RenderWidgetHostViewQtDelegate a pure interface. · fb62607e
      Jocelyn Turcotte authored
      
      RenderWidgetHostViewQtDelegate acts as a bidirectional interface to
      avoid exporting Chromium symbols outside of the core dynamic library.
      
      The problem is that, other than this, from the top layer point of
      view, its responsibilities are the same as RenderWidgetHostViewQt,
      and it would be better not to split its logic without properly
      defined responsibilities.
      
      Using it as a base class and interfacing through its protected
      methods is also cumbersome and make the destination of calls on the
      upper layer difficult to discern.
      
      Use instead a dual pure interface mechanism like WebContentsAdapter
      and pass the callback client interface directly in
      WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate.
      This allows RenderWidgetHostViewQtDelegate to be solely what it
      should be, an interface.
      
      Change-Id: I4e55439ae7f9539cc9e360f0756fbf391405f3b7
      Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
      fb62607e
  13. Nov 04, 2013
    • Pierre Rossi's avatar
      Implement QWebEnginePage::runJavaScript · a99fdc02
      Pierre Rossi authored
      
      We can't have QWebFrame::evaluateJavascript in its old form for
      several reasons, the first of which being that we don't have a
      QWebEngineFrame class anymore. This is worked around by adding
      an optional QString parameter with the frame's XPath.
      
      Another issue is that the WebKit1 API was synchronous, and this would
      not play nicely with the very asynchronous nature of chromium we're
      now sitting on top of. In order to make this obvious when porting, we
      rename it to runJavaScript which doesn't return any result.
      
      This also introduces a template member function overload that will
      accept function pointers, functors and lambdas,much like Qt5's new
      signal/slot syntax, in order to get the result of the javascript
      evaluation back.
      
      Change-Id: I64e15a6f5a168936c52a4da2cef6285dfd16e0d5
      Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
      Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
      a99fdc02
  14. Oct 29, 2013
  15. Oct 24, 2013
  16. Oct 17, 2013
  17. Oct 11, 2013
    • Pierre Rossi's avatar
      Add preliminary context menu support · 3062467e
      Pierre Rossi authored
      
      This is essentially the widgets part, with some tricks to get it to
      honor the widget's context menu policy.
      It enables c++11 for the widgets library for the convenience of using lambdas,
      which admitedly we could do without, but seems reasonable considering our timeline
      and the fact that we build chromium that way.
      
      Change-Id: I6a632a78d2aa48fb0dfecfe491e92651d12407db
      Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
      3062467e
  18. Oct 04, 2013
    • Arvid Nilsson's avatar
      Add loadProgress API · f7842507
      Arvid Nilsson authored
      This exposes loadProgress in both widget and quick webengineviews.
      However, the progress will not change until we get an upstream change
      in Chromium where the content LoadProgressChanged API is exposed to all
      ports, not just Android. The upstream change is
      https://src.chromium.org/viewvc/chrome?revision=221010&view=revision
      
      
      
      Once we get that change, you'll see the widget example browser start to
      paint a blue progress rectangle in the background of the URL bar. Also,
      a progress bar was added to the quicknanobrowser, but it will be stuck
      at 0 for now.
      
      Change-Id: Icbaa01b86c013e0052b3abb7672c38e57128f44a
      Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
      f7842507
  19. Oct 03, 2013
    • Arvid Nilsson's avatar
      Quick: Add Favicon API · ef6cb53a
      Arvid Nilsson authored
      
      Adds a favicon API modelled after the WebKit2 QQuickWebView API, but
      using an http(s) URL instead of a custom protocol, because there's no
      icondatabase yet.
      
      The icon URL lingers even when a new load is committed, until the load
      finishes. It might be more prudent to clear the icon when committing a
      new load, but I opted to let the app take care of that detail if
      desired. Many browsers show a spinner instead of the favicon while
      loading, for example.
      
      There's no widget API implementation for favicons yet, because that API
      only makes sense if we have a full-fledged icon database (case in
      point: QWebEngineSettings::iconForUrl()).
      
      Change-Id: I1e7b85104c80de2ae46a5fe9a273104d43a5c71f
      Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
      ef6cb53a
  20. Oct 01, 2013
  21. Sep 25, 2013
  22. Sep 17, 2013
  23. Sep 02, 2013
    • Jocelyn Turcotte's avatar
      Implement window creation through QWebEnginePage::createWindow. · 7146fcc1
      Jocelyn Turcotte authored
      
      This makes the necessary changes to handle
      WebContentsDelegateQt::AddNewContents and funnel the callback
      through createWindow in QWebEnginePage and QWebEngineView.
      
      - Expose the AddNewContents callback through WebContentsAdapterClient
      - Allow creating a WebContentsAdapter attached only on the Chromium side,
        leaving the choice to QWebEnginePage to either adopt it and call
        WebContentsAdapter::initialize to attach itself as the client, or
        destroy it if the application isn't handling the call.
      - Delay the InitAsChild handling in RenderWidgetHostViewQt when
        it is called before an adapter client has been attached.
      - Since WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate
        is only a factory method, not creating any link with the callee client,
        allow using the creating window's adapter client to create the RWHVQtDelegate.
        This allows an unparented delegate to be created instead of needing to
        add numerous null-checks in RWHVQt.
        Use content::WebContents::CreateParams::context for this purpose,
        which can be used both when creating a WebContents ourselves and when
        a new window's WebContents is created for us.
      
      Change-Id: I032262e867931dc40a7c2eca0c993027a555f56e
      Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
      7146fcc1
  24. Aug 20, 2013