summaryrefslogtreecommitdiffstats
path: root/src/core/browser_context_adapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid full storage update on installing URL scheme handlersJoerg Bornemann2016-01-191-1/+1
| | | | | | | | | | | When installing/removing URL scheme handlers, do not update the full URLRequestContextStorage. Only update the job factory. This avoids calling the - potentially expensive - generateStorage() method superfluously often. Change-Id: I99c4ec479fcfdee4e97d86b858ea42f3cdccfec4 Task-number: QTBUG-50160 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix crash in BrowserContextAdapter::removeCustomUrlSchemeHandlerJoerg Bornemann2016-01-151-2/+2
| | | | | | | | Do not cache the end iterator, because erase might invalidate it. Do not increment the iterator in the erase case. Change-Id: I1cbad04fdaaf1bf4cfae252bb7569d817b6ab5a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix access of freed dataAllan Sandfeld Jensen2016-01-151-7/+7
| | | | | | | | | The string parts inside the lambda construction were already freed, so instead use a simpler construction where we are sure we are still holding the stringlist. Change-Id: I3559ab9d203b368e2d62efef73497ce7f9135cc5 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Fix access violation error because of access to an invalid QString.Alexandru Croitor2016-01-121-1/+1
| | | | | | | | | | | Commit 6ed125c0073288f46e544b9d415d1f9a9968cb2d introduced the usage of QT_USE_QSTRINGBUILDER, which caused an issue in BrowserContextAdapter::httpAcceptLanguageWithoutQualities, incorrectly deducing the return type of the lambda. Fix consists in explicitly setting the return type of the lambda to QString. Change-Id: If3f8992e031838e899d35bcd2f962d051976a8f7 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Implicitly use QStringBuilder in all modulesJoerg Bornemann2016-01-091-1/+0
| | | | | | | | | | | Every Qt module is built with QT_USE_QSTRINGBUILDER by default. Also define QT_USE_QSTRINGBUILDER in the core API library. Remove superfluous qstringbuilder.h includes. Keep the use of operator% to make sure that QT_USE_QSTRINGBUILDER won't vanish in future build system changes. Change-Id: I41fd036fc4e6063951cd758aaafdf9aefed7dd5a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Rename QWebEngineCookieStoreClient to QWebEngineCookieStoreMichal Klocek2015-12-011-4/+4
| | | | | Change-Id: I8f9a4c5c155a65ede24908799218fd867db0767c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Do not require to subclass/install QWebEngineCookieStoreClientKai Koehne2015-10-191-7/+2
| | | | | | | | | The class has only setters and getters, except for the virtual acceptCookie method. By replacing this method with a setCookieFilter callback we can avoid the need of users to subclass the client. Change-Id: Id78c01fc103b8d9cc267594527239b598e8975f1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Decouple scheme and url scheme handlerAllan Sandfeld Jensen2015-10-161-2/+28
| | | | | | | | | Remove the scheme from the url scheme handler constructor, this way the same handler can handle multiple schemes, the API look more natural and we can get rid of the private class. Change-Id: I33906b8a5ea51641e28a53f93f4feb1472c24baf Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Remove unnecessay delegation over CustomUrlSchemeHandlerAllan Sandfeld Jensen2015-10-061-4/+3
| | | | | | | | | | | With QWebEngineSchemeHandler in QtWebEngineCore, we do not need the indirection and delegation CustomUrlSchemeHandler provided. This means the class can be removed and we can also store the handlers directly in BrowserContextAdapter and save a copy of the installed handlers in the QWebEngineProfile. Change-Id: Iabb5cc9d364c2f2a879bc77bfb2ff14b3c2ff640 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Remove whitespaces from custom HTTP user agentsSzabolcs David2015-09-291-2/+2
| | | | | | | | | This prevents adding additional headers to the outgoing HTTP request through overridden user agent and unskips userAgentNewlineStripping API test. Change-Id: If9b3a88b0346058a7dc462471637d9777683fe82 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Allan Sandfeld Jensen2015-09-241-0/+7
|\ | | | | | | Change-Id: Ice3d6e88238940a62d75e7c67f63b626285fccb0
| * Fix httpUserAgent setting after the view's initializationSzabolcs David2015-09-241-0/+7
| | | | | | | | | | | | | | | | | | | | Set user agent override on all WebContents of the specific BrowserContext. Task-number: QTBUG-47976 Change-Id: I4fc6f8d79aff6f372ca48d82642b3eab60f933d1 Reviewed-by: Jocelyn Turcotte (Woboq GmbH) <jturcotte@woboq.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Move custom URL scheme handlers to coreAllan Sandfeld Jensen2015-08-271-0/+6
| | | | | | | | | | | | | | | | Makes the custom URL scheme handler API public, and moves it to core so that it may be shared with the QQuickWebEngine API. Change-Id: I745cb088df6f4cd11b1ac7c8c3c76f112032cb38 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | set Accept-Language in content::RendererPreferencesJoerg Bornemann2015-08-241-0/+12
| | | | | | | | | | | | | | This amends commit 2a56ec7ce4713711b55bb1dfc86a4320d943f606. Change-Id: I8103197f08c985557000de36c37ad80e1ceadf24 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | add API to set the Accept-Language HTTP request-header fieldJoerg Bornemann2015-08-041-0/+10
| | | | | | | | | | | | | | | | | | | | Add methods to set the Accept-Language field in QWebEngineProfile and QQuickWebEngineProfile. Task-number: QTBUG-47412 Change-Id: Ifa376bb3551fdc1fb3d68279d734b7f7735782fc Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Add API for intercepting url requestsAndras Becsi2015-08-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is adding a QWebEngineUrlRequestInterceptor interface that can be subclassed to observe or intercept all resource requests making it possible to implement browser features like adblocking and setting custom request headers for url requests. The interceptRequest virtual function is executed on the IO thread. This patch also includes a unit test for the testable API parts. Change-Id: Ibe740fc55551a9a5da40794088ccb6d03d913631 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Martin Rotter <rotter.martinos@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Permission Management for Chromium 44Allan Sandfeld Jensen2015-07-011-0/+6
| | | | | | | | | | | | | | Implementing the new PermissionManager API. Change-Id: If0fdac24b8fec561a898aba009345576b5ce7fc6 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Add QWebEngineCookieStoreClient core APIAndras Becsi2015-06-161-0/+12
|/ | | | | | | | | | | | | | | | | This class or its subclass can be set on the QWebEngineProfile and its API enables intercepting Chromium's cookies, setting and deleting cookies in the cookie store. These functions are asynchronous so if the result of the task is needed the user can provide a callback which will be run on the calling thread when the requested operation finishes. This does not include a hook for QQuick layer yet, there we have to figure out what the most convenient way is from a developer's perspective. Change-Id: I6a3af071883ce632df7a2fb952da93f306ac3fe2 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Clean up global profiles and ownershipAllan Sandfeld Jensen2015-03-121-5/+9
| | | | | | | | | | | | | This patch removes the unused global off-the-record browser-contexts and changes all browser-contexts to be ref-counted by an API level profile. The API default profiles are now owned by a global QObject and are deleted on exit. Change-Id: Id7c9eafa24829118105f58b66663a6348216823d Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Add namespace to internal QtWebEngine APIAllan Sandfeld Jensen2015-03-021-0/+4
| | | | | | | | Adds the QtWebEngineCore namespace to all internal core API. This ensures we don't export any internal symbols in the global namespace. Change-Id: I26af888ea7c6c4c4d0f04c24a377c1a9d3c92751 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Introduce a user scripts mechanismPierre Rossi2015-02-211-0/+8
| | | | | | | | | | | | | | | Allowing programmatic injection of JavaScript to accomplish all sorts of tasks on the render process side. This API gives control over the point during the loading phase at which the script is run, whether it is run on sub-frames or not, as well as the JavaScript world it is run in (either the page's main world, or an arbitrary isolated world). This only has the Widgets API. The Quick API, tests and docs are coming in separate patches Change-Id: Ia1c79f68f8dfd4d964281d9723d09062ed7abe46 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Experimental custom URL scheme APIAllan Sandfeld Jensen2015-02-191-0/+11
| | | | | | | | Introduces API for custom URL scheme as an experimental API in widgets. A QML api is not included yet. Change-Id: Ice4542e5238feb961a4c9c60a809455e31dc1ec6 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-161-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ieb6bac7a1be5c25eb7cb917495b58b6a870ca6d4 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Update Chromium to version 40.0.2214.28 and ninja to 1.5.3.Zeno Albisser2015-01-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scoped_refptr operator for implicit conversion to pointer has been disabled upstream: https://codereview.chromium.org/510323002 * Group permission API as done upstream: https://codereview.chromium.org/622793002 * content_worker gyp target has been removed upstream. * GetPageThumbnailData moved to DevToolsManagerDelegate. * ui/ui_resources has been renamed to ui/resources * WebPreferences and ResourceType have moved inside content. * Merge ResourceBundle's InitSharedInstanceLocaleOnly with InitSharedInstanceWithLocale(): https://codereview.chromium.org/457103003 * Remove obsolete accessibility events. * AX_EVENT_SELECTED_TEXT_CHANGED has been renamed to AX_EVENT_TEXT_SELECTION_CHANGED * AX_ROLE_MATH_ELEMENT was removed upstream. https://codereview.chromium.org/695133002 * Screen::IsDIPEnabled has been removed upstream. https://codereview.chromium.org/672823002 * Update DevToolsHttpHandlerDelegateQt according to ShellDevToolsManagerDelegate. * Various functionality from DevToolsHttpHandler was moved to DevToolsManagerDelegate https://codereview.chromium.org/560323005 * DevToolsHttpHandler::Start expects a scoped_ptr now. * Make sure event_factory_evdev.h is not included when USE_OZONE is not defined * ErrorPageParams was moved into namespace error_page. * Media Access is now handled by ContentBrowserClient::CheckMediaAccessPermission * SpecialStoragePolicy moved to namespace storage * Add implementation for new pure virtual function BrowserContext::GetSSLHostStateDelegate. * RenderPass::Id was renamed to RenderPass::RenderPassId * Include view_messages.h for ViewHostMsg_TextInputState_Param * CERT_UNABLE_TO_CHECK_REVOCATION has been deprecated by Chromium: https://codereview.chromium.org/449743002 * MailboxManager::ConsumeTexture only takes the mailbox as an argument * Replace RWHVQt::TextInputStateChanged with RWHVQt::TextInputTypeChanged. * RenderWidgetHostView::ScrollOffsetChanged has been removed. * SkBitmap::Config was removed upstream. * CopyFromCompositingSurfaceCallback has become an own type. * AcceleratedSurfaceInitialized only takes route_id as an argument. * ServerBoundCertService has been renamed to ChannelIDService. Related API has been renamed accordingly. * TextureImageTransportSurface was removed upstream. * Update MediaCaptureDispatcher::OnMediaRequestStateChanged signature. * AudioStream related functions are gone upstream. https://codereview.chromium.org/569713002 * Add implementation for RenderWidgetHostViewQt::GetLastScrollOffset. * Include generic touch_device implementation. * switches::kDisableDesktopNotifications was removed upstream. https://codereview.chromium.org/607843002 * PageTransition moved to ui. * Messages headers are not guarded. Including them multiple times does hurt. * ScaleGestureDetector does not create a standalone GestureDetector anymore. https://codereview.chromium.org/501503003 * MotionEvent::Cancel and Clone are not virtual anymore. https://codereview.chromium.org/502993004 * Exclude os_exchange_data_provider_mac from build. * Remove argument from ScopedClipboardWriter ctor. https://codereview.chromium.org/558913003 * Remove ShowPopupMenu override from WebContentsQt. The function is not pure virtual anymore, and we never implemented any specifics. * Do not use clang on desktop linux. * Request functions in ContentBrowserClient were merged into RequestPermission. * ninja: use configure.py --bootstrap instead of bootstrap.py Change-Id: I3575612826db7845461a949b4e737264bb4e8d88 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Add QML download APIAndras Becsi2015-01-121-0/+22
| | | | | | | | | | | | | | | | This patch exposes downloadStarted and downloadFinished signals on the WebEngineProfile to notify about downloads. The WebEngineDownloadItem exposes a subset of Chromium's content::DownloadItem functionality. For now we expose minimal requirements to be able to control downloads in QML but this can be extended in the future. This patch also adds a DownloadView to quicktestbrowser to demonstrate the usage of the new API. [ChangeLog][QtWebEngineQML] Add QtQuick download API Change-Id: I8d8f0daf02c4e0151000427fc2a4b37d28b9db52 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* API for controlling tracking of visited linksAllan Sandfeld Jensen2015-01-081-0/+45
| | | | | | | | | Also fixes updating the visited links manager when off-the-record changes or a storage path is set or changed. Change-Id: Iffa90edde35f2d84146f3ab3b3861ef113e321f3 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
* Do not use QDir::separator()Allan Sandfeld Jensen2015-01-071-4/+4
| | | | | | | | Build all paths Qt-style using / separators, and only convert it when converted to Chromium types. Change-Id: I181be6edb903f38e1772bcd324972d1d4e6672fc Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Introduce QWebEngineProfile APIAllan Sandfeld Jensen2014-12-121-6/+155
| | | | | | | | | | | | | | | Introduces initial widgets API for the Chromium BrowserContext. Adds API for controlling cookie jar policy, user-agent string and cache and persistent data paths. Similar QML API will follow in another patch. [ChangeLog][QtWebEngineWidgets][QWebEngineProfile] New API for profiles applying to groups of QWebEnginePages. Change-Id: I3c4ef4053fde7564af29178c91a0aca8a2b61a5f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Make BrowserContext name configurableAllan Sandfeld Jensen2014-11-261-7/+7
| | | | | | | Add a name to BrowserContexts to separate cookies and cache paths. Change-Id: I3f00444dc7e87d1a63383053e91a4bc7056553bb Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Refactor path building from QStandardPathPierre Rossi2014-11-191-14/+13
| | | | | | | | The duplicated logic was made apparent by the merge conflict resolution. Change-Id: Ib4558ca0b6b5084f851282916cbc9a6615ed33f9 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Merge remote-tracking branch 'origin/5.4' into devAllan Sandfeld Jensen2014-11-111-1/+13
| | | | | | | | Conflicts: src/core/browser_context_qt.cpp src/webengine/api/qquickwebengineview_p.h Change-Id: I73bdec03b627b282851d7dda12006d4ab631072c
* Unglobalize browserContextAllan Sandfeld Jensen2014-11-061-0/+89
This patch makes it possible to have more than one BrowserContext, for instance for off-the-record browsering but also to enable any other configuration on browser context level. This will make it possible to add page-groups settings and API for settingsthat can only be done on BrowserContext level. This patch does not expose any new API. Change-Id: I0a0e194449cfb5a096a4ac6e2f2b3882b6b4cfa2 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>