summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/access_token_store_qt.cpp25
-rw-r--r--src/core/access_token_store_qt.h25
-rw-r--r--src/core/api/core_api.pro2
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp25
-rw-r--r--src/core/api/qtwebenginecoreglobal.h25
-rw-r--r--src/core/api/qtwebenginecoreglobal_p.h25
-rw-r--r--src/core/api/qwebenginecallback.h25
-rw-r--r--src/core/api/qwebenginecallback_p.h25
-rw-r--r--src/core/api/qwebenginecookiestore.cpp25
-rw-r--r--src/core/api/qwebenginecookiestore.h25
-rw-r--r--src/core/api/qwebenginecookiestore_p.h25
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp31
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h27
-rw-r--r--src/core/api/qwebengineurlrequestinfo_p.h25
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.h25
-rw-r--r--src/core/api/qwebengineurlrequestjob.cpp25
-rw-r--r--src/core/api/qwebengineurlrequestjob.h25
-rw-r--r--src/core/api/qwebengineurlschemehandler.cpp25
-rw-r--r--src/core/api/qwebengineurlschemehandler.h25
-rw-r--r--src/core/authentication_dialog_controller.cpp25
-rw-r--r--src/core/authentication_dialog_controller.h25
-rw-r--r--src/core/authentication_dialog_controller_p.h25
-rw-r--r--src/core/browser_accessibility_manager_qt.cpp40
-rw-r--r--src/core/browser_accessibility_manager_qt.h25
-rw-r--r--src/core/browser_accessibility_qt.cpp121
-rw-r--r--src/core/browser_accessibility_qt.h40
-rw-r--r--src/core/browser_context_adapter.cpp73
-rw-r--r--src/core/browser_context_adapter.h42
-rw-r--r--src/core/browser_context_adapter_client.h34
-rw-r--r--src/core/browser_context_qt.cpp100
-rw-r--r--src/core/browser_context_qt.h46
-rw-r--r--src/core/browser_message_filter_qt.cpp98
-rw-r--r--src/core/browser_message_filter_qt.h74
-rw-r--r--src/core/certificate_error_controller.cpp47
-rw-r--r--src/core/certificate_error_controller.h28
-rw-r--r--src/core/certificate_error_controller_p.h25
-rw-r--r--src/core/chrome_qt.gyp121
-rw-r--r--src/core/chromium_gpu_helper.cpp50
-rw-r--r--src/core/chromium_gpu_helper.h30
-rw-r--r--src/core/chromium_overrides.cpp40
-rw-r--r--src/core/chromium_overrides.h25
-rw-r--r--src/core/clipboard_qt.cpp31
-rw-r--r--src/core/clipboard_qt.h31
-rw-r--r--src/core/color_chooser_controller.cpp102
-rw-r--r--src/core/color_chooser_controller.h75
-rw-r--r--src/core/color_chooser_controller_p.h73
-rw-r--r--src/core/color_chooser_qt.cpp60
-rw-r--r--src/core/color_chooser_qt.h74
-rw-r--r--src/core/common/qt_messages.h38
-rw-r--r--src/core/common/user_script_data.cpp27
-rw-r--r--src/core/common/user_script_data.h30
-rw-r--r--src/core/config/common.pri4
-rw-r--r--src/core/config/desktop_linux.pri2
-rw-r--r--src/core/config/embedded_linux.pri4
-rw-r--r--src/core/config/embedded_qnx.pri1
-rw-r--r--src/core/config/linux.pri15
-rw-r--r--src/core/config/mac_osx.pri18
-rw-r--r--src/core/config/windows.pri22
-rw-r--r--src/core/content_browser_client_qt.cpp77
-rw-r--r--src/core/content_browser_client_qt.h47
-rw-r--r--src/core/content_client_qt.cpp167
-rw-r--r--src/core/content_client_qt.h25
-rw-r--r--src/core/content_main_delegate_qt.cpp74
-rw-r--r--src/core/content_main_delegate_qt.h25
-rw-r--r--src/core/cookie_monster_delegate_qt.cpp25
-rw-r--r--src/core/cookie_monster_delegate_qt.h25
-rw-r--r--src/core/core_gyp_generator.pro21
-rw-r--r--src/core/core_module.pro26
-rw-r--r--src/core/custom_protocol_handler.cpp25
-rw-r--r--src/core/custom_protocol_handler.h25
-rw-r--r--src/core/delegated_frame_node.cpp276
-rw-r--r--src/core/delegated_frame_node.h35
-rw-r--r--src/core/desktop_screen_qt.cpp25
-rw-r--r--src/core/desktop_screen_qt.h25
-rw-r--r--src/core/dev_tools_http_handler_delegate_qt.cpp32
-rw-r--r--src/core/dev_tools_http_handler_delegate_qt.h27
-rw-r--r--src/core/doc/src/qtwebenginecore-index.qdoc10
-rw-r--r--src/core/doc/src/qtwebenginecore-module.qdoc10
-rw-r--r--src/core/download_manager_delegate_qt.cpp85
-rw-r--r--src/core/download_manager_delegate_qt.h36
-rw-r--r--src/core/favicon_manager.cpp409
-rw-r--r--src/core/favicon_manager.h117
-rw-r--r--src/core/favicon_manager_p.h106
-rw-r--r--src/core/file_picker_controller.cpp29
-rw-r--r--src/core/file_picker_controller.h29
-rw-r--r--src/core/gl_context_qt.cpp25
-rw-r--r--src/core/gl_context_qt.h25
-rw-r--r--src/core/gl_surface_qt.cpp44
-rw-r--r--src/core/gl_surface_qt.h25
-rw-r--r--src/core/gyp_run.pro27
-rw-r--r--src/core/javascript_dialog_controller.cpp25
-rw-r--r--src/core/javascript_dialog_controller.h25
-rw-r--r--src/core/javascript_dialog_controller_p.h25
-rw-r--r--src/core/javascript_dialog_manager_qt.cpp29
-rw-r--r--src/core/javascript_dialog_manager_qt.h25
-rw-r--r--src/core/location_provider_qt.cpp25
-rw-r--r--src/core/location_provider_qt.h25
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp48
-rw-r--r--src/core/media_capture_devices_dispatcher.h27
-rw-r--r--src/core/native_web_keyboard_event_qt.cpp25
-rw-r--r--src/core/network_delegate_qt.cpp40
-rw-r--r--src/core/network_delegate_qt.h31
-rw-r--r--src/core/ozone_platform_eglfs.cpp38
-rw-r--r--src/core/ozone_platform_eglfs.h26
-rw-r--r--src/core/permission_manager_qt.cpp111
-rw-r--r--src/core/permission_manager_qt.h58
-rw-r--r--src/core/print_view_manager_base_qt.cpp521
-rw-r--r--src/core/print_view_manager_base_qt.h150
-rw-r--r--src/core/print_view_manager_qt.cpp320
-rw-r--r--src/core/print_view_manager_qt.h130
-rw-r--r--src/core/printing_message_filter_qt.cpp261
-rw-r--r--src/core/printing_message_filter_qt.h138
-rw-r--r--src/core/process_main.cpp27
-rw-r--r--src/core/process_main.h25
-rw-r--r--src/core/proxy_config_service_qt.cpp29
-rw-r--r--src/core/proxy_config_service_qt.h28
-rw-r--r--src/core/qrc_protocol_handler_qt.cpp25
-rw-r--r--src/core/qrc_protocol_handler_qt.h25
-rw-r--r--src/core/qtwebengine.gypi23
-rw-r--r--src/core/qtwebengine_extras.gypi22
-rw-r--r--src/core/render_view_observer_host_qt.cpp25
-rw-r--r--src/core/render_view_observer_host_qt.h25
-rw-r--r--src/core/render_widget_host_view_qt.cpp109
-rw-r--r--src/core/render_widget_host_view_qt.h44
-rw-r--r--src/core/render_widget_host_view_qt_delegate.h25
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp218
-rw-r--r--src/core/renderer/content_renderer_client_qt.h35
-rw-r--r--src/core/renderer/pepper/pepper_flash_browser_host_qt.cpp27
-rw-r--r--src/core/renderer/pepper/pepper_flash_browser_host_qt.h26
-rw-r--r--src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.cpp4
-rw-r--r--src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.h1
-rw-r--r--src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp30
-rw-r--r--src/core/renderer/pepper/pepper_flash_renderer_host_qt.h26
-rw-r--r--src/core/renderer/pepper/pepper_host_factory_qt.cpp45
-rw-r--r--src/core/renderer/pepper/pepper_host_factory_qt.h25
-rw-r--r--src/core/renderer/pepper/pepper_isolated_file_system_message_filter.cpp133
-rw-r--r--src/core/renderer/pepper/pepper_isolated_file_system_message_filter.h89
-rw-r--r--src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp30
-rw-r--r--src/core/renderer/pepper/pepper_renderer_host_factory_qt.h27
-rw-r--r--src/core/renderer/print_web_view_helper_delegate_qt.cpp72
-rw-r--r--src/core/renderer/print_web_view_helper_delegate_qt.h65
-rw-r--r--src/core/renderer/render_frame_observer_qt.cpp30
-rw-r--r--src/core/renderer/render_frame_observer_qt.h26
-rw-r--r--src/core/renderer/render_view_observer_qt.cpp25
-rw-r--r--src/core/renderer/render_view_observer_qt.h25
-rw-r--r--src/core/renderer/user_resource_controller.cpp (renamed from src/core/renderer/user_script_controller.cpp)115
-rw-r--r--src/core/renderer/user_resource_controller.h (renamed from src/core/renderer/user_script_controller.h)43
-rw-r--r--src/core/renderer/web_channel_ipc_transport.cpp167
-rw-r--r--src/core/renderer/web_channel_ipc_transport.h35
-rw-r--r--src/core/resource_bundle_qt.cpp26
-rw-r--r--src/core/resource_context_qt.cpp25
-rw-r--r--src/core/resource_context_qt.h25
-rw-r--r--src/core/resource_dispatcher_host_delegate_qt.cpp41
-rw-r--r--src/core/resource_dispatcher_host_delegate_qt.h31
-rw-r--r--src/core/resources/resources.gyp14
-rw-r--r--src/core/stream_video_node.cpp25
-rw-r--r--src/core/stream_video_node.h25
-rw-r--r--src/core/surface_factory_qt.cpp25
-rw-r--r--src/core/surface_factory_qt.h25
-rw-r--r--src/core/type_conversion.cpp104
-rw-r--r--src/core/type_conversion.h59
-rw-r--r--src/core/url_request_context_getter_qt.cpp95
-rw-r--r--src/core/url_request_context_getter_qt.h28
-rw-r--r--src/core/url_request_custom_job.cpp60
-rw-r--r--src/core/url_request_custom_job.h27
-rw-r--r--src/core/url_request_custom_job_delegate.cpp25
-rw-r--r--src/core/url_request_custom_job_delegate.h25
-rw-r--r--src/core/url_request_qrc_job_qt.cpp38
-rw-r--r--src/core/url_request_qrc_job_qt.h27
-rw-r--r--src/core/user_resource_controller_host.cpp (renamed from src/core/user_script_controller_host.cpp)79
-rw-r--r--src/core/user_resource_controller_host.h (renamed from src/core/user_script_controller_host.h)39
-rw-r--r--src/core/user_script.cpp26
-rw-r--r--src/core/user_script.h29
-rw-r--r--src/core/web_channel_ipc_transport_host.cpp47
-rw-r--r--src/core/web_channel_ipc_transport_host.h34
-rw-r--r--src/core/web_contents_adapter.cpp368
-rw-r--r--src/core/web_contents_adapter.h58
-rw-r--r--src/core/web_contents_adapter_client.h49
-rw-r--r--src/core/web_contents_adapter_p.h40
-rw-r--r--src/core/web_contents_delegate_qt.cpp111
-rw-r--r--src/core/web_contents_delegate_qt.h37
-rw-r--r--src/core/web_contents_view_qt.cpp102
-rw-r--r--src/core/web_contents_view_qt.h31
-rw-r--r--src/core/web_engine_context.cpp106
-rw-r--r--src/core/web_engine_context.h43
-rw-r--r--src/core/web_engine_error.cpp25
-rw-r--r--src/core/web_engine_error.h25
-rw-r--r--src/core/web_engine_library_info.cpp49
-rw-r--r--src/core/web_engine_library_info.h28
-rw-r--r--src/core/web_engine_settings.cpp157
-rw-r--r--src/core/web_engine_settings.h40
-rw-r--r--src/core/web_engine_visited_links_manager.cpp25
-rw-r--r--src/core/web_engine_visited_links_manager.h25
-rw-r--r--src/core/web_event_factory.cpp23
-rw-r--r--src/core/web_event_factory.h25
-rw-r--r--src/core/yuv_video_node.cpp30
-rw-r--r--src/core/yuv_video_node.h25
197 files changed, 7787 insertions, 2653 deletions
diff --git a/src/core/access_token_store_qt.cpp b/src/core/access_token_store_qt.cpp
index b657a633a..6c4cbc610 100644
--- a/src/core/access_token_store_qt.cpp
+++ b/src/core/access_token_store_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/access_token_store_qt.h b/src/core/access_token_store_qt.h
index 6b8cfa2a2..0f45fd3a0 100644
--- a/src/core/access_token_store_qt.h
+++ b/src/core/access_token_store_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
index a9f5adaba..6e2d606b2 100644
--- a/src/core/api/core_api.pro
+++ b/src/core/api/core_api.pro
@@ -15,7 +15,7 @@ CONFIG -= create_prl
# Copy this logic from qt_module.prf so that the intermediate library can be
# created to the same rules as the final module linking in core_module.pro.
!host_build:if(win32|mac):!macx-xcode {
- contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
+ contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
contains(QT_CONFIG, build_all):CONFIG += build_all
}
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index f4edae0e6..f5d1e6d39 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qtwebenginecoreglobal.h b/src/core/api/qtwebenginecoreglobal.h
index a17b355eb..012c5d4f0 100644
--- a/src/core/api/qtwebenginecoreglobal.h
+++ b/src/core/api/qtwebenginecoreglobal.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qtwebenginecoreglobal_p.h b/src/core/api/qtwebenginecoreglobal_p.h
index e93ca9c2c..0a6ae3f91 100644
--- a/src/core/api/qtwebenginecoreglobal_p.h
+++ b/src/core/api/qtwebenginecoreglobal_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebenginecallback.h b/src/core/api/qwebenginecallback.h
index 3bb993757..9c7e43b92 100644
--- a/src/core/api/qwebenginecallback.h
+++ b/src/core/api/qwebenginecallback.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebenginecallback_p.h b/src/core/api/qwebenginecallback_p.h
index f93e863eb..b88ef4d2c 100644
--- a/src/core/api/qwebenginecallback_p.h
+++ b/src/core/api/qwebenginecallback_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index df537a787..4617882ab 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index eac976fae..5001ba3a1 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index 41456cfdc..90380f2c6 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index f229a9748..bd2fecac2 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -59,6 +62,8 @@ ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::RESOU
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::RESOURCE_TYPE_XHR)
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::RESOURCE_TYPE_PING)
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::RESOURCE_TYPE_SERVICE_WORKER)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, content::RESOURCE_TYPE_CSP_REPORT)
+ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, content::RESOURCE_TYPE_PLUGIN_RESOURCE)
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeUnknown, content::RESOURCE_TYPE_LAST_TYPE)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink)
@@ -165,6 +170,10 @@ QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPriva
\value ResourceTypeXhr An XMLHttpRequest.
\value ResourceTypePing A ping request for <a ping>.
\value ResourceTypeServiceWorker The main resource of a service worker.
+ \value ResourceTypeCspReport A report of Content Security Policy (CSP)
+ violations. CSP reports are in JSON format and they are delivered by
+ HTTP POST requests to specified servers. (Added in Qt 5.7)
+ \value ResourceTypePluginResource A resource requested by a plugin. (Added in Qt 5.7)
\value ResourceTypeUnknown Unknown request type.
*/
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index 9a13b3faf..d75ceabf6 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -70,6 +73,8 @@ public:
ResourceTypeXhr, // a XMLHttpRequest
ResourceTypePing, // a ping request for <a ping>
ResourceTypeServiceWorker, // the main resource of a service worker.
+ ResourceTypeCspReport, // Content Security Policy (CSP) violation report
+ ResourceTypePluginResource, // A resource requested by a plugin
ResourceTypeUnknown
};
diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h
index c78a93613..9afd04398 100644
--- a/src/core/api/qwebengineurlrequestinfo_p.h
+++ b/src/core/api/qwebengineurlrequestinfo_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index e9f9c8d5f..6e0f93e49 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp
index 0e56ba5b3..1db23f6ab 100644
--- a/src/core/api/qwebengineurlrequestjob.cpp
+++ b/src/core/api/qwebengineurlrequestjob.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h
index 84741b791..afa542d7e 100644
--- a/src/core/api/qwebengineurlrequestjob.h
+++ b/src/core/api/qwebengineurlrequestjob.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp
index 485db0b4b..e60d90d04 100644
--- a/src/core/api/qwebengineurlschemehandler.cpp
+++ b/src/core/api/qwebengineurlschemehandler.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index 738bc281b..757c461f4 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/authentication_dialog_controller.cpp b/src/core/authentication_dialog_controller.cpp
index db534a24e..2f70ea923 100644
--- a/src/core/authentication_dialog_controller.cpp
+++ b/src/core/authentication_dialog_controller.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/authentication_dialog_controller.h b/src/core/authentication_dialog_controller.h
index ae741f537..2fa4e854f 100644
--- a/src/core/authentication_dialog_controller.h
+++ b/src/core/authentication_dialog_controller.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/authentication_dialog_controller_p.h b/src/core/authentication_dialog_controller_p.h
index 5b1d21ae0..2acc588e1 100644
--- a/src/core/authentication_dialog_controller_p.h
+++ b/src/core/authentication_dialog_controller_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 7c59db110..bd3c5e7d9 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -44,12 +47,12 @@ using namespace blink;
namespace content {
BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
- const ui::AXTreeUpdate& initial_tree,
+ const ui::AXTreeUpdate& initialTree,
BrowserAccessibilityDelegate* delegate,
BrowserAccessibilityFactory* factory)
{
#ifndef QT_NO_ACCESSIBILITY
- return new BrowserAccessibilityManagerQt(0, initial_tree, delegate);
+ return new BrowserAccessibilityManagerQt(0, initialTree, delegate);
#else
return 0;
#endif // QT_NO_ACCESSIBILITY
@@ -66,12 +69,11 @@ BrowserAccessibility *BrowserAccessibilityFactoryQt::Create()
#ifndef QT_NO_ACCESSIBILITY
BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
- QObject* parentObject,
- const ui::AXTreeUpdate& initialTree,
- BrowserAccessibilityDelegate* delegate,
- BrowserAccessibilityFactory* factory)
- : BrowserAccessibilityManager(delegate, factory)
- , m_parentObject(parentObject) {
+ QObject *parentObject, const ui::AXTreeUpdate &initialTree,
+ BrowserAccessibilityDelegate* delegate, BrowserAccessibilityFactory* factory)
+ : BrowserAccessibilityManager(delegate, factory)
+ , m_parentObject(parentObject)
+{
Initialize(initialTree);
}
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index 08dcdf4c6..4ff9fb699 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index ebf99e950..fecbac111 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -59,84 +62,6 @@ BrowserAccessibilityQt::BrowserAccessibilityQt()
QAccessible::registerAccessibleInterface(this);
}
-// This function is taken from chromium/content/browser/accessibility/browser_accessibility_win.cc
-// see also http://www.w3.org/TR/html-aapi
-void BrowserAccessibilityQt::OnDataChanged()
-{
- BrowserAccessibility::OnDataChanged();
-
- // The calculation of the accessible name of an element has been
- // standardized in the HTML to Platform Accessibility APIs Implementation
- // Guide (http://www.w3.org/TR/html-aapi/). In order to return the
- // appropriate accessible name on Windows, we need to apply some logic
- // to the fields we get from WebKit.
- //
- // TODO(dmazzoni): move most of this logic into WebKit.
- //
- // WebKit gives us:
- //
- // name: the default name, e.g. inner text
- // title ui element: a reference to a <label> element on the same
- // page that labels this node.
- // description: accessible labels that override the default name:
- // aria-label or aria-labelledby or aria-describedby
- // help: the value of the "title" attribute
- //
- // On Windows, the logic we apply lets some fields take precedence and
- // always returns the primary name in "name" and the secondary name,
- // if any, in "description".
-
- int title_elem_id = GetIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT);
- base::string16 name = GetString16Attribute(ui::AX_ATTR_NAME);
- base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION);
- base::string16 help = GetString16Attribute(ui::AX_ATTR_HELP);
- base::string16 value = GetString16Attribute(ui::AX_ATTR_VALUE);
-
- // WebKit annoyingly puts the title in the description if there's no other
- // description, which just confuses the rest of the logic. Put it back.
- // Now "help" is always the value of the "title" attribute, if present.
- base::string16 title_attr;
- if (GetHtmlAttribute("title", &title_attr) &&
- description == title_attr &&
- help.empty()) {
- help = description;
- description.clear();
- }
-
- // Now implement the main logic: the descripion should become the name if
- // it's nonempty, and the help should become the description if
- // there's no description - or the name if there's no name or description.
- if (!description.empty()) {
- name = description;
- description.clear();
- }
- if (!help.empty() && description.empty()) {
- description = help;
- help.clear();
- }
- if (!description.empty() && name.empty() && !title_elem_id) {
- name = description;
- description.clear();
- }
-
- // If it's a text field, also consider the placeholder.
- base::string16 placeholder;
- if (GetRole() == ui::AX_ROLE_TEXT_FIELD &&
- HasState(ui::AX_STATE_FOCUSABLE) &&
- GetHtmlAttribute("placeholder", &placeholder)) {
- if (name.empty() && !title_elem_id) {
- name = placeholder;
- } else if (description.empty()) {
- description = placeholder;
- }
- }
-
- m_name = toQt(name);
- m_description = toQt(description);
- m_help = toQt(help);
- m_value = toQt(value);
-}
-
bool BrowserAccessibilityQt::isValid() const
{
return true;
@@ -166,7 +91,7 @@ void *BrowserAccessibilityQt::interface_cast(QAccessible::InterfaceType type)
return static_cast<QAccessibleActionInterface*>(this);
break;
case QAccessible::TextInterface:
- if (IsEditableText())
+ if (HasState(ui::AX_STATE_EDITABLE))
return static_cast<QAccessibleTextInterface*>(this);
break;
case QAccessible::ValueInterface: {
@@ -229,13 +154,11 @@ QString BrowserAccessibilityQt::text(QAccessible::Text t) const
{
switch (t) {
case QAccessible::Name:
- return name();
+ return toQt(GetStringAttribute(ui::AX_ATTR_NAME));
case QAccessible::Description:
- return description();
- case QAccessible::Help:
- return help();
+ return toQt(GetStringAttribute(ui::AX_ATTR_DESCRIPTION));
case QAccessible::Value:
- return value();
+ return toQt(GetStringAttribute(ui::AX_ATTR_VALUE));
case QAccessible::Accelerator:
return toQt(GetStringAttribute(ui::AX_ATTR_SHORTCUT));
default:
@@ -482,7 +405,7 @@ QAccessible::Role BrowserAccessibilityQt::role() const
QAccessible::State BrowserAccessibilityQt::state() const
{
QAccessible::State state = QAccessible::State();
- int32 s = GetState();
+ int32_t s = GetState();
if (s & (1 << ui::AX_STATE_BUSY))
state.busy = true;
if (s & (1 << ui::AX_STATE_CHECKED))
@@ -501,8 +424,6 @@ QAccessible::State BrowserAccessibilityQt::state() const
state.hasPopup = true;
if (s & (1 << ui::AX_STATE_HOVERED))
state.hotTracked = true;
- if (s & (1 << ui::AX_STATE_INDETERMINATE))
- {} // FIXME
if (s & (1 << ui::AX_STATE_INVISIBLE))
state.invisible = true;
if (s & (1 << ui::AX_STATE_LINKED))
@@ -527,7 +448,7 @@ QAccessible::State BrowserAccessibilityQt::state() const
{} // FIXME
if (s & (1 << ui::AX_STATE_VISITED))
{} // FIXME
- if (IsEditableText())
+ if (HasState(ui::AX_STATE_EDITABLE))
state.editable = true;
return state;
}
@@ -710,7 +631,7 @@ QAccessibleInterface *BrowserAccessibilityQt::cellAt(int row, int column) const
if (row < 0 || row >= rows || column < 0 || column >= columns)
return 0;
- const std::vector<int32>& cell_ids = GetIntListAttribute(ui::AX_ATTR_CELL_IDS);
+ const std::vector<int32_t>& cell_ids = GetIntListAttribute(ui::AX_ATTR_CELL_IDS);
DCHECK_EQ(columns * rows, static_cast<int>(cell_ids.size()));
int cell_id = cell_ids[row * columns + column];
diff --git a/src/core/browser_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index b7b4c39bc..186bd7d84 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -55,9 +58,6 @@ class BrowserAccessibilityQt
public:
BrowserAccessibilityQt();
- // BrowserAccessibility
- virtual void OnDataChanged() Q_DECL_OVERRIDE;
-
// QAccessibleInterface
virtual bool isValid() const Q_DECL_OVERRIDE;
virtual QObject *object() const Q_DECL_OVERRIDE;
@@ -142,18 +142,6 @@ public:
virtual QAccessibleInterface* table() const Q_DECL_OVERRIDE;
virtual void modelChange(QAccessibleTableModelChangeEvent *event) Q_DECL_OVERRIDE;
-
- QString name() const { return m_name; }
- QString description() const { return m_description; }
- QString help() const { return m_help; }
- QString value() const { return m_value; }
-
-private:
- // IAccessible name, description, help, value.
- QString m_name;
- QString m_description;
- QString m_help;
- QString m_value;
};
}
diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp
index 66cbdb040..24e2dc2c2 100644
--- a/src/core/browser_context_adapter.cpp
+++ b/src/core/browser_context_adapter.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -45,7 +48,7 @@
#include "web_engine_context.h"
#include "web_engine_visited_links_manager.h"
#include "url_request_context_getter_qt.h"
-#include "user_script_controller_host.h"
+#include "user_resource_controller_host.h"
#include "net/proxy/proxy_service.h"
@@ -420,11 +423,11 @@ void BrowserContextAdapter::clearCustomUrlSchemeHandlers()
updateCustomUrlSchemeHandlers();
}
-UserScriptControllerHost *BrowserContextAdapter::userScriptController()
+UserResourceControllerHost *BrowserContextAdapter::userResourceController()
{
- if (!m_userScriptController)
- m_userScriptController.reset(new UserScriptControllerHost);
- return m_userScriptController.data();
+ if (!m_userResourceController)
+ m_userResourceController.reset(new UserResourceControllerHost);
+ return m_userResourceController.data();
}
void BrowserContextAdapter::permissionRequestReply(const QUrl &origin, PermissionType type, bool reply)
@@ -473,6 +476,44 @@ void BrowserContextAdapter::setHttpAcceptLanguage(const QString &httpAcceptLangu
m_browserContext->url_request_getter_->updateUserAgent();
}
+void BrowserContextAdapter::clearHttpCache()
+{
+ if (m_browserContext->url_request_getter_.get())
+ m_browserContext->url_request_getter_->clearHttpCache();
+}
+
+void BrowserContextAdapter::setSpellCheckLanguage(const QString &language)
+{
+#if defined(ENABLE_SPELLCHECK)
+ m_browserContext->setSpellCheckLanguage(language);
+#endif
+}
+
+QString BrowserContextAdapter::spellCheckLanguage() const
+{
+#if defined(ENABLE_SPELLCHECK)
+ return m_browserContext->spellCheckLanguage();
+#else
+ return QString();
+#endif
+}
+
+void BrowserContextAdapter::setSpellCheckEnabled(bool enabled)
+{
+#if defined(ENABLE_SPELLCHECK)
+ m_browserContext->setSpellCheckEnabled(enabled);
+#endif
+}
+
+bool BrowserContextAdapter::isSpellCheckEnabled() const
+{
+#if defined(ENABLE_SPELLCHECK)
+ return m_browserContext->isSpellCheckEnabled();
+#else
+ return false;
+#endif
+}
+
void BrowserContextAdapter::resetVisitedLinksManager()
{
m_visitedLinksManager.reset(new WebEngineVisitedLinksManager(this));
diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h
index 162f89a2d..a6e5a2a3e 100644
--- a/src/core/browser_context_adapter.h
+++ b/src/core/browser_context_adapter.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -57,7 +60,7 @@ namespace QtWebEngineCore {
class BrowserContextAdapterClient;
class BrowserContextQt;
class DownloadManagerDelegateQt;
-class UserScriptControllerHost;
+class UserResourceControllerHost;
class WebEngineVisitedLinksManager;
class QWEBENGINE_EXPORT BrowserContextAdapter : public QEnableSharedFromThis<BrowserContextAdapter>
@@ -105,10 +108,17 @@ public:
QString httpUserAgent() const;
void setHttpUserAgent(const QString &userAgent);
+ QStringList spellCheckLanguages(const QStringList &acceptLanguages);
+ void setSpellCheckLanguage(const QString &language);
+ QString spellCheckLanguage() const;
+ void setSpellCheckEnabled(bool enabled);
+ bool isSpellCheckEnabled() const;
+
// KEEP IN SYNC with API or add mapping layer
enum HttpCacheType {
MemoryHttpCache = 0,
- DiskHttpCache
+ DiskHttpCache,
+ NoCache
};
enum PersistentCookiesPolicy {
@@ -153,7 +163,7 @@ public:
void addCustomUrlSchemeHandler(const QByteArray &, QWebEngineUrlSchemeHandler *);
bool removeCustomUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
QWebEngineUrlSchemeHandler *takeCustomUrlSchemeHandler(const QByteArray &);
- UserScriptControllerHost *userScriptController();
+ UserResourceControllerHost *userResourceController();
void permissionRequestReply(const QUrl &origin, PermissionType type, bool reply);
bool checkPermission(const QUrl &origin, PermissionType type);
@@ -162,6 +172,8 @@ public:
QString httpAcceptLanguage() const;
void setHttpAcceptLanguage(const QString &httpAcceptLanguage);
+ void clearHttpCache();
+
private:
void updateCustomUrlSchemeHandlers();
void resetVisitedLinksManager();
@@ -171,7 +183,7 @@ private:
QScopedPointer<BrowserContextQt> m_browserContext;
QScopedPointer<WebEngineVisitedLinksManager> m_visitedLinksManager;
QScopedPointer<DownloadManagerDelegateQt> m_downloadManagerDelegate;
- QScopedPointer<UserScriptControllerHost> m_userScriptController;
+ QScopedPointer<UserResourceControllerHost> m_userResourceController;
QScopedPointer<QWebEngineCookieStore> m_cookieStore;
QPointer<QWebEngineUrlRequestInterceptor> m_requestInterceptor;
diff --git a/src/core/browser_context_adapter_client.h b/src/core/browser_context_adapter_client.h
index efa889e75..2df8c21cb 100644
--- a/src/core/browser_context_adapter_client.h
+++ b/src/core/browser_context_adapter_client.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -58,6 +61,14 @@ public:
DownloadInterrupted
};
+ // Keep in sync with content::SavePageType
+ enum SavePageFormat {
+ UnknownSavePageFormat = -1,
+ SingleHtmlSaveFormat,
+ CompleteHtmlSaveFormat,
+ MimeHtmlSaveFormat
+ };
+
struct DownloadItemInfo {
const quint32 id;
const QUrl url;
@@ -67,6 +78,7 @@ public:
const QString mimeType;
QString path;
+ int savePageFormat;
bool accepted;
};
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp
index a59c0b196..1c326fb83 100644
--- a/src/core/browser_context_qt.cpp
+++ b/src/core/browser_context_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -44,18 +47,54 @@
#include "ssl_host_state_delegate_qt.h"
#include "type_conversion.h"
#include "url_request_context_getter_qt.h"
+#include "web_engine_library_info.h"
#include "base/time/time.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "net/proxy/proxy_config_service.h"
+#if defined(ENABLE_SPELLCHECK)
+#include "base/base_paths.h"
+#include "base/prefs/pref_member.h"
+#include "base/prefs/pref_service.h"
+#include "base/prefs/testing_pref_store.h"
+#include "base/prefs/pref_service.h"
+#include "base/prefs/pref_service_factory.h"
+#include "base/prefs/pref_registry_simple.h"
+#include "components/user_prefs/user_prefs.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/browser/spellchecker/spellcheck_service.h"
+#endif
+
namespace QtWebEngineCore {
+#if defined(ENABLE_SPELLCHECK)
+BrowserContextQt::BrowserContextQt(BrowserContextAdapter *adapter)
+ : m_adapter(adapter),
+ m_prefStore(new TestingPrefStore())
+{
+ m_prefStore->SetInitializationCompleted();
+ base::PrefServiceFactory factory;
+ factory.set_user_prefs(m_prefStore);
+ scoped_refptr<PrefRegistrySimple> registry(new PrefRegistrySimple());
+
+ // Initial spellcheck settings
+ registry->RegisterListPref(prefs::kSpellCheckDictionaries, new base::ListValue());
+ registry->RegisterStringPref(prefs::kAcceptLanguages, std::string());
+ registry->RegisterStringPref(prefs::kSpellCheckDictionary, std::string());
+ registry->RegisterBooleanPref(prefs::kSpellCheckUseSpellingService, false);
+ registry->RegisterBooleanPref(prefs::kEnableContinuousSpellcheck, false);
+ registry->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, false);
+ m_prefService = factory.Create(std::move(registry.get()));
+ user_prefs::UserPrefs::Set(this, m_prefService.get());
+}
+#else
BrowserContextQt::BrowserContextQt(BrowserContextAdapter *adapter)
: m_adapter(adapter)
{
}
+#endif //ENABLE_SPELLCHECK
BrowserContextQt::~BrowserContextQt()
{
@@ -143,6 +182,11 @@ scoped_ptr<content::ZoomLevelDelegate> BrowserContextQt::CreateZoomLevelDelegate
return nullptr;
}
+content::BackgroundSyncController* BrowserContextQt::GetBackgroundSyncController()
+{
+ return nullptr;
+}
+
content::PermissionManager *BrowserContextQt::GetPermissionManager()
{
if (!permissionManager)
@@ -152,8 +196,40 @@ content::PermissionManager *BrowserContextQt::GetPermissionManager()
net::URLRequestContextGetter *BrowserContextQt::CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors)
{
- url_request_getter_ = new URLRequestContextGetterQt(m_adapter->sharedFromThis(), protocol_handlers, request_interceptors.Pass());
+ url_request_getter_ = new URLRequestContextGetterQt(m_adapter->sharedFromThis(), protocol_handlers, std::move(request_interceptors));
return url_request_getter_.get();
}
+#if defined(ENABLE_SPELLCHECK)
+void BrowserContextQt::failedToLoadDictionary(const std::string &language)
+{
+ Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ qWarning() << "Could not load dictionary for:" << toQt(language) << endl
+ << "Make sure that correct bdic file is in:" << toQt(WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES).value());
+}
+
+void BrowserContextQt::setSpellCheckLanguage(const QString &language)
+{
+ base::ListValue dictionaries;
+ dictionaries.AppendString(language.toStdString());
+ m_prefService->Set(prefs::kSpellCheckDictionaries, dictionaries);
+}
+
+QString BrowserContextQt::spellCheckLanguage() const
+{
+ std::string dictionary;
+ m_prefService->GetList(prefs::kSpellCheckDictionaries)->GetString(0, &dictionary);
+ return QString::fromStdString(dictionary);
+}
+
+void BrowserContextQt::setSpellCheckEnabled(bool enabled)
+{
+ m_prefService->SetBoolean(prefs::kEnableContinuousSpellcheck, enabled);
+}
+
+bool BrowserContextQt::isSpellCheckEnabled() const
+{
+ return m_prefService->GetBoolean(prefs::kEnableContinuousSpellcheck);
+}
+#endif //ENABLE_SPELLCHECK
} // namespace QtWebEngineCore
diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h
index ba6e1dce1..e2156f147 100644
--- a/src/core/browser_context_qt.h
+++ b/src/core/browser_context_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -44,6 +47,14 @@
#include <QtCore/qcompilerdetection.h> // Needed for Q_DECL_OVERRIDE
+#if defined(ENABLE_SPELLCHECK)
+QT_BEGIN_NAMESPACE
+class QStringList;
+QT_END_NAMESPACE
+class TestingPrefStore;
+class PrefService;
+#endif
+
namespace QtWebEngineCore {
class BrowserContextAdapter;
@@ -76,9 +87,18 @@ public:
net::URLRequestContextGetter *CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors);
virtual scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(const base::FilePath& partition_path) Q_DECL_OVERRIDE;
virtual content::PermissionManager *GetPermissionManager() Q_DECL_OVERRIDE;
+ virtual content::BackgroundSyncController* GetBackgroundSyncController() Q_DECL_OVERRIDE;
BrowserContextAdapter *adapter() { return m_adapter; }
+#if defined(ENABLE_SPELLCHECK)
+ void failedToLoadDictionary(const std::string& language) override;
+ void setSpellCheckLanguage(const QString &language);
+ QString spellCheckLanguage() const;
+ void setSpellCheckEnabled(bool enabled);
+ bool isSpellCheckEnabled() const;
+#endif
+
private:
friend class ContentBrowserClientQt;
friend class WebContentsAdapter;
@@ -87,6 +107,10 @@ private:
scoped_ptr<PermissionManagerQt> permissionManager;
scoped_ptr<SSLHostStateDelegateQt> sslHostStateDelegate;
BrowserContextAdapter *m_adapter;
+#if defined(ENABLE_SPELLCHECK)
+ scoped_refptr<TestingPrefStore> m_prefStore;
+ scoped_ptr<PrefService> m_prefService;
+#endif
friend class BrowserContextAdapter;
DISALLOW_COPY_AND_ASSIGN(BrowserContextQt);
diff --git a/src/core/browser_message_filter_qt.cpp b/src/core/browser_message_filter_qt.cpp
new file mode 100644
index 000000000..7551e5616
--- /dev/null
+++ b/src/core/browser_message_filter_qt.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "browser_message_filter_qt.h"
+
+#include "common/qt_messages.h"
+#include "content/public/browser/plugin_service.h"
+#include "type_conversion.h"
+
+namespace QtWebEngineCore {
+
+BrowserMessageFilterQt::BrowserMessageFilterQt(int /*render_process_id*/)
+ : BrowserMessageFilter(QtMsgStart)
+{
+}
+
+// The following is based on chrome/browser/plugins/plugin_info_message_filter.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+bool BrowserMessageFilterQt::OnMessageReceived(const IPC::Message& message)
+{
+ IPC_BEGIN_MESSAGE_MAP(BrowserMessageFilterQt, message)
+#if defined(ENABLE_PEPPER_CDMS)
+ IPC_MESSAGE_HANDLER(
+ QtWebEngineHostMsg_IsInternalPluginAvailableForMimeType,
+ OnIsInternalPluginAvailableForMimeType)
+#endif
+ IPC_MESSAGE_UNHANDLED(return false)
+ IPC_END_MESSAGE_MAP()
+ return true;
+}
+
+#if defined(ENABLE_PEPPER_CDMS)
+void BrowserMessageFilterQt::OnIsInternalPluginAvailableForMimeType(
+ const std::string& mime_type, bool* is_available,
+ std::vector<base::string16>* additional_param_names,
+ std::vector<base::string16>* additional_param_values)
+{
+ std::vector<content::WebPluginInfo> plugins;
+ content::PluginService::GetInstance()->GetInternalPlugins(&plugins);
+
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ const content::WebPluginInfo& plugin = plugins[i];
+ const std::vector<content::WebPluginMimeType>& mime_types = plugin.mime_types;
+ for (size_t j = 0; j < mime_types.size(); ++j) {
+ if (mime_types[j].mime_type == mime_type) {
+ *is_available = true;
+ *additional_param_names = mime_types[j].additional_param_names;
+ *additional_param_values = mime_types[j].additional_param_values;
+ return;
+ }
+ }
+ }
+
+ *is_available = false;
+}
+
+#endif // defined(ENABLE_PEPPER_CDMS)
+
+} // namespace QtWebEngineCore
diff --git a/src/core/browser_message_filter_qt.h b/src/core/browser_message_filter_qt.h
new file mode 100644
index 000000000..75ca9fd84
--- /dev/null
+++ b/src/core/browser_message_filter_qt.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BROWSER_MESSAGE_FILTER_QT_H
+#define BROWSER_MESSAGE_FILTER_QT_H
+
+#include "content/public/browser/browser_message_filter.h"
+
+#include <QtGlobal>
+
+namespace QtWebEngineCore {
+
+class BrowserMessageFilterQt : public content::BrowserMessageFilter
+{
+public:
+ BrowserMessageFilterQt(int render_process_id);
+
+private:
+ bool OnMessageReceived(const IPC::Message& message) Q_DECL_OVERRIDE;
+#if defined(ENABLE_PEPPER_CDMS)
+ // Returns whether any internal plugin supporting |mime_type| is registered
+ // and enabled. Does not determine whether the plugin can actually be
+ // instantiated (e.g. whether it has all its dependencies).
+ // When the returned *|is_available| is true, |additional_param_names| and
+ // |additional_param_values| contain the name-value pairs, if any, specified
+ // for the *first* non-disabled plugin found that is registered for
+ // |mime_type|.
+ void OnIsInternalPluginAvailableForMimeType(
+ const std::string& mime_type,
+ bool* is_available,
+ std::vector<base::string16>* additional_param_names,
+ std::vector<base::string16>* additional_param_values);
+#endif
+};
+
+} // namespace QtWebEngineCore
+
+#endif // BROWSER_MESSAGE_FILTER_QT_H
diff --git a/src/core/certificate_error_controller.cpp b/src/core/certificate_error_controller.cpp
index 3a95458ea..65bba733a 100644
--- a/src/core/certificate_error_controller.cpp
+++ b/src/core/certificate_error_controller.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,16 +40,34 @@
#include "certificate_error_controller.h"
#include "certificate_error_controller_p.h"
+#include <net/base/net_errors.h>
#include <net/cert/x509_certificate.h>
#include <net/ssl/ssl_info.h>
#include <ui/base/l10n/l10n_util.h>
#include "chrome/grit/generated_resources.h"
+#include "components/strings/grit/components_strings.h"
#include "type_conversion.h"
QT_BEGIN_NAMESPACE
using namespace QtWebEngineCore;
+ASSERT_ENUMS_MATCH(CertificateErrorController::SslPinnedKeyNotInCertificateChain, net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateCommonNameInvalid, net::ERR_CERT_BEGIN)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateCommonNameInvalid, net::ERR_CERT_COMMON_NAME_INVALID)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateDateInvalid, net::ERR_CERT_DATE_INVALID)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateAuthorityInvalid, net::ERR_CERT_AUTHORITY_INVALID)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateContainsErrors, net::ERR_CERT_CONTAINS_ERRORS)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateUnableToCheckRevocation, net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateRevoked, net::ERR_CERT_REVOKED)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateInvalid, net::ERR_CERT_INVALID)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateWeakSignatureAlgorithm, net::ERR_CERT_WEAK_SIGNATURE_ALGORITHM)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateNonUniqueName, net::ERR_CERT_NON_UNIQUE_NAME)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateWeakKey, net::ERR_CERT_WEAK_KEY)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateNameConstraintViolation, net::ERR_CERT_NAME_CONSTRAINT_VIOLATION)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateValidityTooLong, net::ERR_CERT_VALIDITY_TOO_LONG)
+ASSERT_ENUMS_MATCH(CertificateErrorController::CertificateErrorEnd, net::ERR_CERT_END)
+
void CertificateErrorControllerPrivate::accept(bool accepted)
{
callback.Run(accepted);
@@ -125,7 +146,7 @@ QString CertificateErrorController::errorString() const
// formatted text.
switch (d->certError) {
case SslPinnedKeyNotInCertificateChain:
- return getQStringForMessageId(IDS_ERRORPAGES_SUMMARY_PINNING_FAILURE);
+ return getQStringForMessageId(IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DETAILS);
case CertificateCommonNameInvalid:
return getQStringForMessageId(IDS_CERT_ERROR_COMMON_NAME_INVALID_DESCRIPTION);
case CertificateDateInvalid:
@@ -151,6 +172,8 @@ QString CertificateErrorController::errorString() const
return getQStringForMessageId(IDS_CERT_ERROR_WEAK_KEY_DESCRIPTION);
case CertificateNameConstraintViolation:
return getQStringForMessageId(IDS_CERT_ERROR_NAME_CONSTRAINT_VIOLATION_DESCRIPTION);
+ case CertificateValidityTooLong:
+ return getQStringForMessageId(IDS_CERT_ERROR_VALIDITY_TOO_LONG_DESCRIPTION);
case CertificateUnableToCheckRevocation: // Deprecated in Chromium.
default:
break;
diff --git a/src/core/certificate_error_controller.h b/src/core/certificate_error_controller.h
index 5ee35c77c..27f18946f 100644
--- a/src/core/certificate_error_controller.h
+++ b/src/core/certificate_error_controller.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -67,6 +70,9 @@ public:
CertificateNonUniqueName = -210,
CertificateWeakKey = -211,
CertificateNameConstraintViolation = -212,
+ CertificateValidityTooLong = -213,
+
+ CertificateErrorEnd = -214 // not an error, just an enum boundary
};
CertificateError error() const;
diff --git a/src/core/certificate_error_controller_p.h b/src/core/certificate_error_controller_p.h
index 08b51f30f..ee073b64f 100644
--- a/src/core/certificate_error_controller_p.h
+++ b/src/core/certificate_error_controller_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/chrome_qt.gyp b/src/core/chrome_qt.gyp
index de49d8826..f2d7c5831 100644
--- a/src/core/chrome_qt.gyp
+++ b/src/core/chrome_qt.gyp
@@ -1,6 +1,61 @@
{
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
+ 'chrome_spellchecker_sources': [
+ '<(DEPTH)/base/prefs/testing_pref_store.cc',
+ '<(DEPTH)/base/prefs/testing_pref_store.h',
+ '<(DEPTH)/chrome/browser/spellchecker/feedback.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/feedback.h',
+ '<(DEPTH)/chrome/browser/spellchecker/feedback_sender.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/feedback_sender.h',
+ '<(DEPTH)/chrome/browser/spellchecker/misspelling.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/misspelling.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_action.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_action.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_custom_dictionary.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_factory.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_factory.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_host_metrics.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_host_metrics.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter_platform.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_platform_mac.mm',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_service.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spellcheck_service.h',
+ '<(DEPTH)/chrome/browser/spellchecker/spelling_service_client.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/spelling_service_client.h',
+ '<(DEPTH)/chrome/browser/spellchecker/word_trimmer.cc',
+ '<(DEPTH)/chrome/browser/spellchecker/word_trimmer.h',
+ '<(DEPTH)/chrome/common/common_message_generator.cc',
+ '<(DEPTH)/chrome/common/pref_names.cc',
+ '<(DEPTH)/chrome/common/pref_names.h',
+ '<(DEPTH)/chrome/common/spellcheck_bdict_language.h',
+ '<(DEPTH)/chrome/common/spellcheck_common.cc',
+ '<(DEPTH)/chrome/common/spellcheck_common.h',
+ '<(DEPTH)/chrome/common/spellcheck_marker.h',
+ '<(DEPTH)/chrome/common/spellcheck_messages.h',
+ '<(DEPTH)/chrome/common/spellcheck_result.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/custom_dictionary_engine.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/custom_dictionary_engine.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/hunspell_engine.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/hunspell_engine.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/platform_spelling_engine.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/platform_spelling_engine.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck_language.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck_language.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck_provider.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck_provider.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck_worditerator.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/spellcheck_worditerator.h',
+ '<(DEPTH)/chrome/renderer/spellchecker/spelling_engine.h',
+ ]
},
'targets': [
{
@@ -8,22 +63,84 @@
'type': 'static_library',
'dependencies': [
'chrome_resources',
+ '<(chromium_src_dir)/components/components_strings.gyp:components_strings',
],
'include_dirs': [
'./',
'<(chromium_src_dir)',
'<(chromium_src_dir)/skia/config',
- '<(SHARED_INTERMEDIATE_DIR)/chrome', # Needed to include grit-generated files in localized_error.cc
+ '<(chromium_src_dir)/third_party/skia/include/core',
+ # Needed to include grit-generated files in localized_error.cc:
+ '<(SHARED_INTERMEDIATE_DIR)/chrome',
+ '<(SHARED_INTERMEDIATE_DIR)/components/strings',
],
'sources': [
+ '<(DEPTH)/chrome/browser/media/desktop_media_list.h',
'<(DEPTH)/chrome/browser/media/desktop_streams_registry.cc',
'<(DEPTH)/chrome/browser/media/desktop_streams_registry.h',
- '<(DEPTH)/chrome/browser/media/desktop_media_list.h',
'<(DEPTH)/chrome/common/chrome_switches.cc',
'<(DEPTH)/chrome/common/chrome_switches.h',
'<(DEPTH)/chrome/common/localized_error.cc',
'<(DEPTH)/chrome/common/localized_error.h',
],
+ 'conditions': [
+ ['enable_spellcheck==1', {
+ 'sources': [ '<@(chrome_spellchecker_sources)' ],
+ 'include_dirs': [
+ '<(chromium_src_dir)/third_party/WebKit',
+ ],
+ 'dependencies': [
+ '<(chromium_src_dir)/components/components.gyp:keyed_service_content',
+ '<(chromium_src_dir)/components/components.gyp:keyed_service_core',
+ '<(chromium_src_dir)/components/components.gyp:pref_registry',
+ '<(chromium_src_dir)/components/components.gyp:user_prefs',
+ '<(chromium_src_dir)/third_party/hunspell/hunspell.gyp:hunspell',
+ '<(chromium_src_dir)/third_party/icu/icu.gyp:icui18n',
+ '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
+ ],
+ 'defines': [
+ '__STDC_CONSTANT_MACROS',
+ '__STDC_FORMAT_MACROS',
+ ],
+ 'conditions': [
+ ['OS == "win"', {
+ # crbug.com/167187 fix size_t to int truncations
+ 'msvs_disabled_warnings': [4267, ],
+ }],
+ [ 'OS != "mac"', {
+ 'sources/': [
+ ['exclude', '_mac\\.(cc|cpp|mm?)$'],
+ ],
+ }],
+ ['use_browser_spellchecker==0', {
+ 'sources!': [
+ '<(DEPTH)/chrome/renderer/spellchecker/platform_spelling_engine.cc',
+ '<(DEPTH)/chrome/renderer/spellchecker/platform_spelling_engine.h',
+ ],
+ }],
+ ],
+ }],
+ ['enable_basic_printing==1 or enable_print_preview==1', {
+ 'sources': [
+ '<(DEPTH)/chrome/browser/printing/print_job.cc',
+ '<(DEPTH)/chrome/browser/printing/print_job.h',
+ '<(DEPTH)/chrome/browser/printing/print_job_manager.cc',
+ '<(DEPTH)/chrome/browser/printing/print_job_manager.h',
+ '<(DEPTH)/chrome/browser/printing/print_job_worker.cc',
+ '<(DEPTH)/chrome/browser/printing/print_job_worker.h',
+ '<(DEPTH)/chrome/browser/printing/print_job_worker_owner.cc',
+ '<(DEPTH)/chrome/browser/printing/print_job_worker_owner.h',
+ '<(DEPTH)/chrome/browser/printing/printer_query.cc',
+ '<(DEPTH)/chrome/browser/printing/printer_query.h',
+ ],
+ 'dependencies': [
+ '<(chromium_src_dir)/third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'include_dirs': [
+ '<(chromium_src_dir)/extensions',
+ ],
+ }],
+ ],
},
{
'target_name': 'chrome_resources',
diff --git a/src/core/chromium_gpu_helper.cpp b/src/core/chromium_gpu_helper.cpp
index 9dfc498ad..349506dbd 100644
--- a/src/core/chromium_gpu_helper.cpp
+++ b/src/core/chromium_gpu_helper.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -54,25 +57,6 @@
#include "content/common/gpu/stream_texture_qnx.h"
#endif
-static void addSyncPointCallbackDelegate(gpu::SyncPointManager *syncPointManager, uint32 sync_point, const base::Closure& callback)
-{
- syncPointManager->AddSyncPointCallback(sync_point, callback);
-}
-
-QMap<uint32, gfx::TransferableFence> transferFences()
-{
- QMap<uint32, gfx::TransferableFence> ret;
- content::GpuChannelManager *gpuChannelManager = content::GpuChildThread::instance()->ChannelManager();
- content::GpuChannelManager::SyncPointGLFences::iterator it = gpuChannelManager->sync_point_gl_fences_.begin();
- content::GpuChannelManager::SyncPointGLFences::iterator end = gpuChannelManager->sync_point_gl_fences_.end();
- for (; it != end; ++it) {
- ret[it->first] = it->second->Transfer();
- delete it->second;
- }
- gpuChannelManager->sync_point_gl_fences_.clear();
- return ret;
-}
-
base::MessageLoop *gpu_message_loop()
{
return content::GpuChildThread::instance()->message_loop();
@@ -84,12 +68,6 @@ gpu::SyncPointManager *sync_point_manager()
return gpuChannelManager->sync_point_manager();
}
-void AddSyncPointCallbackOnGpuThread(base::MessageLoop *gpuMessageLoop, gpu::SyncPointManager *syncPointManager, uint32 sync_point, const base::Closure& callback)
-{
- // We need to set our callback from the GPU thread, where the SyncPointManager lives.
- gpuMessageLoop->PostTask(FROM_HERE, base::Bind(&addSyncPointCallbackDelegate, make_scoped_refptr(syncPointManager), sync_point, callback));
-}
-
gpu::gles2::MailboxManager *mailbox_manager()
{
content::GpuChannelManager *gpuChannelManager = content::GpuChildThread::instance()->ChannelManager();
diff --git a/src/core/chromium_gpu_helper.h b/src/core/chromium_gpu_helper.h
index 6242dd068..02fe2d3bb 100644
--- a/src/core/chromium_gpu_helper.h
+++ b/src/core/chromium_gpu_helper.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,9 +43,6 @@
#include <QtGlobal> // We need this for the Q_OS_QNX define.
#include <QMap>
-#include "base/callback.h"
-#include "ui/gl/gl_fence.h"
-
namespace base {
class MessageLoop;
}
@@ -61,12 +61,10 @@ class Texture;
// From the outside, types from incompatible headers referenced in these
// functions should only be forward-declared and considered as opaque types.
-QMap<uint32, gfx::TransferableFence> transferFences();
base::MessageLoop *gpu_message_loop();
gpu::SyncPointManager *sync_point_manager();
gpu::gles2::MailboxManager *mailbox_manager();
-void AddSyncPointCallbackOnGpuThread(base::MessageLoop *gpuMessageLoop, gpu::SyncPointManager *syncPointManager, uint32 sync_point, const base::Closure& callback);
gpu::gles2::Texture* ConsumeTexture(gpu::gles2::MailboxManager *mailboxManager, unsigned target, const gpu::Mailbox& mailbox);
unsigned int service_id(gpu::gles2::Texture *tex);
diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp
index b9ce722dd..18596c337 100644
--- a/src/core/chromium_overrides.cpp
+++ b/src/core/chromium_overrides.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -128,7 +131,7 @@ scoped_ptr<base::ListValue> GetFontList_SlowBlocking()
// TODO: Support localized family names.
font_list->Append(font_item);
}
- return font_list.Pass();
+ return std::move(font_list);
}
#if defined(ENABLE_PLUGINS)
@@ -157,3 +160,16 @@ OSExchangeData::Provider* OSExchangeData::CreateProvider()
} // namespace ui
#endif // defined(USE_AURA) && !defined(USE_OZONE)
+
+#if defined(USE_OPENSSL_CERTS)
+namespace net {
+class SSLPrivateKey { };
+class X509Certificate;
+
+scoped_ptr<SSLPrivateKey> FetchClientCertPrivateKey(X509Certificate* certificate)
+{
+ return scoped_ptr<SSLPrivateKey>();
+}
+
+} // namespace net
+#endif
diff --git a/src/core/chromium_overrides.h b/src/core/chromium_overrides.h
index 6787729ac..b2bd398af 100644
--- a/src/core/chromium_overrides.h
+++ b/src/core/chromium_overrides.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index 93f239f63..712ff5703 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -312,7 +315,7 @@ void ClipboardQt::ReadAsciiText(ui::ClipboardType type, std::string* result) con
*result = mimeData->text().toStdString();
}
-void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::string* src_url, uint32* fragment_start, uint32* fragment_end) const
+void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::string* src_url, uint32_t* fragment_start, uint32_t* fragment_end) const
{
markup->clear();
if (src_url)
@@ -322,7 +325,7 @@ void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
*markup = toString16(mimeData->html());
- *fragment_end = static_cast<uint32>(markup->length());
+ *fragment_end = static_cast<uint32_t>(markup->length());
}
void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string* result) const
@@ -367,7 +370,7 @@ void ClipboardQt::ReadData(const FormatType& format, std::string* result) const
*result = std::string(byteArray.constData(), byteArray.length());
}
-uint64 ClipboardQt::GetSequenceNumber(ui::ClipboardType type) const
+uint64_t ClipboardQt::GetSequenceNumber(ui::ClipboardType type) const
{
return clipboardChangeObserver()->getSequenceNumber(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
}
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index ee1fc7440..6af4193d9 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -62,7 +65,7 @@ private:
class ClipboardQt : public ui::Clipboard {
public:
- virtual uint64 GetSequenceNumber(ui::ClipboardType type) const Q_DECL_OVERRIDE;
+ virtual uint64_t GetSequenceNumber(ui::ClipboardType type) const Q_DECL_OVERRIDE;
virtual bool IsFormatAvailable(const FormatType& format, ui::ClipboardType type) const Q_DECL_OVERRIDE;
virtual void Clear(ui::ClipboardType type) Q_DECL_OVERRIDE;
virtual void ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16>* types, bool* contains_filenames) const Q_DECL_OVERRIDE;
@@ -71,8 +74,8 @@ public:
virtual void ReadHTML(ui::ClipboardType type,
base::string16* markup,
std::string* src_url,
- uint32* fragment_start,
- uint32* fragment_end) const Q_DECL_OVERRIDE;
+ uint32_t* fragment_start,
+ uint32_t* fragment_end) const Q_DECL_OVERRIDE;
virtual void ReadRTF(ui::ClipboardType type, std::string* result) const Q_DECL_OVERRIDE;
virtual SkBitmap ReadImage(ui::ClipboardType type) const Q_DECL_OVERRIDE;
virtual void ReadCustomData(ui::ClipboardType clipboard_type, const base::string16& type, base::string16* result) const Q_DECL_OVERRIDE;
diff --git a/src/core/color_chooser_controller.cpp b/src/core/color_chooser_controller.cpp
new file mode 100644
index 000000000..26d675908
--- /dev/null
+++ b/src/core/color_chooser_controller.cpp
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "content/browser/web_contents/web_contents_impl.h"
+
+#include "color_chooser_controller.h"
+#include "color_chooser_controller_p.h"
+#include "type_conversion.h"
+
+namespace QtWebEngineCore {
+
+ColorChooserControllerPrivate::ColorChooserControllerPrivate(content::WebContents *content, const QColor &color)
+ : m_content(content)
+ , m_initialColor(color)
+{
+}
+
+ColorChooserController::~ColorChooserController()
+{
+}
+
+ColorChooserController::ColorChooserController(ColorChooserControllerPrivate *dd)
+{
+ Q_ASSERT(dd);
+ d.reset(dd);
+}
+
+QColor ColorChooserController::initialColor() const
+{
+ return d->m_initialColor;
+}
+
+void ColorChooserController::didEndColorDialog()
+{
+ d->m_content->DidEndColorChooser();
+}
+
+void ColorChooserController::didChooseColorInColorDialog(const QColor &color)
+{
+ d->m_content->DidChooseColorInColorChooser(toSk(color));
+}
+
+void ColorChooserController::accept(const QColor &color)
+{
+ didChooseColorInColorDialog(color);
+ didEndColorDialog();
+}
+
+void ColorChooserController::accept(const QVariant &color)
+{
+ QColor selectedColor;
+ if (color.canConvert<QColor>()) {
+ selectedColor = color.value<QColor>();
+ didChooseColorInColorDialog(selectedColor);
+ }
+
+ didEndColorDialog();
+}
+
+void ColorChooserController::reject()
+{
+ didEndColorDialog();
+}
+
+
+} // namespace
diff --git a/src/core/color_chooser_controller.h b/src/core/color_chooser_controller.h
new file mode 100644
index 000000000..c0cb05172
--- /dev/null
+++ b/src/core/color_chooser_controller.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COLOR_CHOOSER_CONTROLLER_H
+#define COLOR_CHOOSER_CONTROLLER_H
+
+#include "qtwebenginecoreglobal.h"
+
+#include <QObject>
+
+namespace QtWebEngineCore {
+
+class ColorChooserControllerPrivate;
+
+class QWEBENGINE_EXPORT ColorChooserController : public QObject {
+ Q_OBJECT
+public:
+ ~ColorChooserController();
+
+ QColor initialColor() const;
+
+ void didEndColorDialog();
+ void didChooseColorInColorDialog(const QColor &);
+
+public Q_SLOTS:
+ void accept(const QColor &);
+ void accept(const QVariant &);
+ void reject();
+
+private:
+ ColorChooserController(ColorChooserControllerPrivate *);
+ QScopedPointer<ColorChooserControllerPrivate> d;
+
+ friend class ColorChooserQt;
+};
+
+} // namespace
+
+#endif // COLOR_CHOOSER_CONTROLLER_H
diff --git a/src/core/color_chooser_controller_p.h b/src/core/color_chooser_controller_p.h
new file mode 100644
index 000000000..a03167f21
--- /dev/null
+++ b/src/core/color_chooser_controller_p.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COLOR_CHOOSER_CONTROLLER_P_H
+#define COLOR_CHOOSER_CONTROLLER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QColor>
+
+namespace content {
+ class WebContents;
+}
+
+namespace QtWebEngineCore {
+
+class ColorChooserControllerPrivate {
+
+public:
+ ColorChooserControllerPrivate(content::WebContents *, const QColor &);
+ content::WebContents *m_content;
+ QColor m_initialColor;
+};
+
+} // namespace
+
+#endif // COLOR_CHOOSER_CONTROLLER_P_H
+
diff --git a/src/core/color_chooser_qt.cpp b/src/core/color_chooser_qt.cpp
new file mode 100644
index 000000000..749d04148
--- /dev/null
+++ b/src/core/color_chooser_qt.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "color_chooser_qt.h"
+#include "color_chooser_controller.h"
+#include "color_chooser_controller_p.h"
+
+namespace content {
+ class WebContents;
+}
+
+namespace QtWebEngineCore {
+
+ColorChooserQt::ColorChooserQt(content::WebContents *content, const QColor &color)
+{
+ m_controller.reset(new ColorChooserController(new ColorChooserControllerPrivate(content, color)));
+}
+
+QSharedPointer<ColorChooserController> ColorChooserQt::controller()
+{
+ return m_controller;
+}
+
+} // namespace
diff --git a/src/core/color_chooser_qt.h b/src/core/color_chooser_qt.h
new file mode 100644
index 000000000..cd9f81fa7
--- /dev/null
+++ b/src/core/color_chooser_qt.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef COLOR_CHOOSER_QT_H
+#define COLOR_CHOOSER_QT_H
+
+#include "content/public/browser/color_chooser.h"
+#include "type_conversion.h"
+
+#include <QColor>
+#include <QSharedPointer>
+
+namespace content {
+ class WebContents;
+}
+
+namespace QtWebEngineCore {
+
+class ColorChooserController;
+
+class ColorChooserQt : public content::ColorChooser
+{
+public:
+ ColorChooserQt(content::WebContents *, const QColor &);
+
+ virtual void SetSelectedColor(SkColor color) Q_DECL_OVERRIDE { }
+ virtual void End() Q_DECL_OVERRIDE {}
+
+ QSharedPointer<ColorChooserController> controller();
+
+private:
+ QSharedPointer<ColorChooserController> m_controller;
+};
+
+
+} // namespace
+
+#endif // COLOR_CHOOSER_QT_H
diff --git a/src/core/common/qt_messages.h b/src/core/common/qt_messages.h
index ae36a0d7f..b8991a2b3 100644
--- a/src/core/common/qt_messages.h
+++ b/src/core/common/qt_messages.h
@@ -26,15 +26,17 @@ IPC_STRUCT_TRAITS_END()
// These are messages sent from the browser to the renderer process.
IPC_MESSAGE_ROUTED1(RenderViewObserverQt_FetchDocumentMarkup,
- uint64 /* requestId */)
+ uint64_t /* requestId */)
IPC_MESSAGE_ROUTED1(RenderViewObserverQt_FetchDocumentInnerText,
- uint64 /* requestId */)
+ uint64_t /* requestId */)
IPC_MESSAGE_ROUTED1(RenderViewObserverQt_SetBackgroundColor,
- uint32 /* color */)
+ uint32_t /* color */)
-IPC_MESSAGE_ROUTED1(WebChannelIPCTransport_Message, std::vector<char> /*binaryJSON*/)
+IPC_MESSAGE_ROUTED1(WebChannelIPCTransport_Install, uint /* worldId */)
+IPC_MESSAGE_ROUTED1(WebChannelIPCTransport_Uninstall, uint /* worldId */)
+IPC_MESSAGE_ROUTED2(WebChannelIPCTransport_Message, std::vector<char> /*binaryJSON*/, uint /* worldId */)
// User scripts messages
IPC_MESSAGE_ROUTED1(RenderViewObserverHelper_AddScript,
@@ -43,22 +45,40 @@ IPC_MESSAGE_ROUTED1(RenderViewObserverHelper_RemoveScript,
UserScriptData /* script */)
IPC_MESSAGE_ROUTED0(RenderViewObserverHelper_ClearScripts)
-IPC_MESSAGE_CONTROL1(UserScriptController_AddScript, UserScriptData /* scriptContents */)
-IPC_MESSAGE_CONTROL1(UserScriptController_RemoveScript, UserScriptData /* scriptContents */)
-IPC_MESSAGE_CONTROL0(UserScriptController_ClearScripts)
+IPC_MESSAGE_CONTROL1(UserResourceController_AddScript, UserScriptData /* scriptContents */)
+IPC_MESSAGE_CONTROL1(UserResourceController_RemoveScript, UserScriptData /* scriptContents */)
+IPC_MESSAGE_CONTROL0(UserResourceController_ClearScripts)
//-----------------------------------------------------------------------------
// WebContents messages
// These are messages sent from the renderer back to the browser process.
IPC_MESSAGE_ROUTED2(RenderViewObserverHostQt_DidFetchDocumentMarkup,
- uint64 /* requestId */,
+ uint64_t /* requestId */,
base::string16 /* markup */)
IPC_MESSAGE_ROUTED2(RenderViewObserverHostQt_DidFetchDocumentInnerText,
- uint64 /* requestId */,
+ uint64_t /* requestId */,
base::string16 /* innerText */)
IPC_MESSAGE_ROUTED0(RenderViewObserverHostQt_DidFirstVisuallyNonEmptyLayout)
IPC_MESSAGE_ROUTED1(WebChannelIPCTransportHost_SendMessage, std::vector<char> /*binaryJSON*/)
+
+//-----------------------------------------------------------------------------
+// Misc messages
+// These are messages sent from the renderer to the browser process.
+
+#if defined(ENABLE_PEPPER_CDMS)
+// Returns whether any internal plugin supporting |mime_type| is registered and
+// enabled. Does not determine whether the plugin can actually be instantiated
+// (e.g. whether it has all its dependencies).
+// When the returned *|is_available| is true, |additional_param_names| and
+// |additional_param_values| contain the name-value pairs, if any, specified
+// for the *first* non-disabled plugin found that is registered for |mime_type|.
+IPC_SYNC_MESSAGE_CONTROL1_3(QtWebEngineHostMsg_IsInternalPluginAvailableForMimeType,
+ std::string /* mime_type */,
+ bool /* is_available */,
+ std::vector<base::string16> /* additional_param_names */,
+ std::vector<base::string16> /* additional_param_values */)
+#endif
diff --git a/src/core/common/user_script_data.cpp b/src/core/common/user_script_data.cpp
index f94ea640c..6f4b8cb05 100644
--- a/src/core/common/user_script_data.cpp
+++ b/src/core/common/user_script_data.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -41,6 +44,6 @@ UserScriptData::UserScriptData() : injectionPoint(AfterLoad)
, injectForSubframes(false)
, worldId(1)
{
- static uint64 idCount = 0;
+ static uint64_t idCount = 0;
scriptId = idCount++;
}
diff --git a/src/core/common/user_script_data.h b/src/core/common/user_script_data.h
index d0856e02a..943d61798 100644
--- a/src/core/common/user_script_data.h
+++ b/src/core/common/user_script_data.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -39,7 +42,6 @@
#include <QtCore/QHash>
#include <string>
-#include "base/basictypes.h"
#include "ipc/ipc_message_utils.h"
#include "url/gurl.h"
@@ -54,10 +56,10 @@ struct UserScriptData {
std::string source;
GURL url;
- /*InjectionPoint*/uint8 injectionPoint;
+ /*InjectionPoint*/uint8_t injectionPoint;
bool injectForSubframes;
uint worldId;
- uint64 scriptId;
+ uint64_t scriptId;
};
QT_BEGIN_NAMESPACE
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
index c5921a573..5822bc589 100644
--- a/src/core/config/common.pri
+++ b/src/core/config/common.pri
@@ -5,6 +5,8 @@ GYP_CONFIG += use_qt=1
# We do not want to ship more external binary blobs, so let v8 embed its startup data.
GYP_CONFIG += v8_use_external_startup_data=0
# Disable printing since we don't support it yet
-GYP_CONFIG += enable_basic_printing=0 enable_print_preview=0
+GYP_CONFIG += enable_basic_printing=1 enable_print_preview=0
# WebSpeech requires Google API keys and adds dependencies on speex and flac.
GYP_CONFIG += enable_web_speech=0
+# We do not use or even include the extensions
+GYP_CONFIG += enable_extensions=0
diff --git a/src/core/config/desktop_linux.pri b/src/core/config/desktop_linux.pri
index ff3cc9170..de0fbbc6b 100644
--- a/src/core/config/desktop_linux.pri
+++ b/src/core/config/desktop_linux.pri
@@ -4,7 +4,7 @@ include(linux.pri)
GYP_CONFIG += \
desktop_linux=1 \
- enable_plugins=1 \
+ enable_widevine=1
clang {
GYP_CONFIG += clang=1 host_clang=1 clang_use_chrome_plugins=0 make_clang_dir=/usr
diff --git a/src/core/config/embedded_linux.pri b/src/core/config/embedded_linux.pri
index 41891859d..4cb7d89fb 100644
--- a/src/core/config/embedded_linux.pri
+++ b/src/core/config/embedded_linux.pri
@@ -9,6 +9,7 @@ GYP_CONFIG += \
embedded=1 \
enable_autofill_dialog=0 \
enable_automation=0 \
+ enable_basic_printing=0 \
enable_captive_portal_detection=0 \
enable_extensions=0 \
enable_google_now=0 \
@@ -18,7 +19,6 @@ GYP_CONFIG += \
enable_plugins=0 \
enable_printing=0 \
enable_session_service=0 \
- enable_spellcheck=0 \
enable_task_manager=0 \
enable_themes=0 \
enable_webrtc=0 \
@@ -38,3 +38,5 @@ GYP_CONFIG += \
use_x11=0 \
v8_use_snapshot=false \
want_separate_host_toolset=1 \
+
+WEBENGINE_CONFIG *= reduce_binary_size
diff --git a/src/core/config/embedded_qnx.pri b/src/core/config/embedded_qnx.pri
index 34470d2d8..c05e8bb59 100644
--- a/src/core/config/embedded_qnx.pri
+++ b/src/core/config/embedded_qnx.pri
@@ -4,6 +4,7 @@ include(common.pri)
GYP_CONFIG += \
disable_nacl=1 \
+ enable_basic_printing=0 \
enable_plugins=0 \
enable_webrtc=0 \
use_ash=0 \
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 39eeb2a90..a318e170c 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -29,11 +29,22 @@ use?(nss) {
use_openssl_certs=1
}
+gcc:!clang: greaterThan(QT_GCC_MAJOR_VERSION, 5): GYP_CONFIG += no_delete_null_pointer_checks=1
+
contains(QT_CONFIG, system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1
contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1
contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1
contains(QT_CONFIG, system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1
-!contains(QT_CONFIG, pulseaudio): GYP_CONFIG += use_pulseaudio=0
+contains(QT_CONFIG, pulseaudio) {
+ GYP_CONFIG += use_pulseaudio=1
+} else {
+ GYP_CONFIG += use_pulseaudio=0
+}
+contains(QT_CONFIG, alsa) {
+ GYP_CONFIG += use_alsa=1
+} else {
+ GYP_CONFIG += use_alsa=0
+}
!contains(QT_CONFIG, glib): GYP_CONFIG += use_glib=0
use?(system_libevent): GYP_CONFIG += use_system_libevent=1
use?(system_libwebp): GYP_CONFIG += use_system_libwebp=1
@@ -45,4 +56,4 @@ use?(system_snappy): GYP_CONFIG += use_system_snappy=1
use?(system_vpx): GYP_CONFIG += use_system_libvpx=1
use?(system_icu): GYP_CONFIG += use_system_icu=1 icu_use_data_file_flag=0
use?(system_ffmpeg): GYP_CONFIG += use_system_ffmpeg=1
-
+use?(system_protobuf): GYP_CONFIG += use_system_protobuf=1
diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
index 940b47982..c447add4a 100644
--- a/src/core/config/mac_osx.pri
+++ b/src/core/config/mac_osx.pri
@@ -1,4 +1,13 @@
include(common.pri)
+load(functions)
+
+# Reuse the cached sdk version value from mac/sdk.prf if available
+# otherwise query for it.
+QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
+isEmpty(QMAKE_MAC_SDK_VERSION) {
+ QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
+ isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
+}
QMAKE_CLANG_DIR = "/usr"
QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX)
@@ -10,14 +19,17 @@ QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX)
QMAKE_CLANG_PATH = "$${QMAKE_CLANG_DIR}/bin/clang++"
message("Using clang++ from $${QMAKE_CLANG_PATH}")
system("$${QMAKE_CLANG_PATH} --version")
-
GYP_CONFIG += \
qt_os=\"mac\" \
- mac_sdk_min=\"10.7\" \
+ mac_sdk_min=\"$${QMAKE_MAC_SDK_VERSION}\" \
mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \
make_clang_dir=\"$${QMAKE_CLANG_DIR}\" \
clang_use_chrome_plugins=0 \
- enable_plugins=1
+ enable_widevine=1
+
+# Force touch API is used in 49-based Chromium, which is included starting with 10.10.3 SDK, so we
+# disable the API usage if the SDK version is lower.
+!isMinOSXSDKVersion(10, 10, 3): GYP_CONFIG += disable_force_touch=1
QMAKE_MAC_SDK_PATH = "$$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)"
exists($$QMAKE_MAC_SDK_PATH): GYP_CONFIG += mac_sdk_path=\"$${QMAKE_MAC_SDK_PATH}\"
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index 760ed5b6f..a99bc5303 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -6,9 +6,7 @@ GYP_CONFIG += \
disable_nacl=1 \
remoting=0 \
use_ash=0 \
-
-# Chromium builds with debug info in release by default but Qt doesn't
-CONFIG(release, debug|release):!force_debug_info: GYP_CONFIG += fastbuild=1
+ enable_widevine=1
# Libvpx build needs additional search path on Windows.
GYP_ARGS += "-D qtwe_chromium_obj_dir=\"$$OUT_PWD/$$getConfigDir()/obj/$${getChromiumSrcDir()}\""
@@ -49,6 +47,14 @@ defineTest(usingMSVC32BitCrossCompiler) {
return(false)
}
+msvc:contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
+ # The 32 bit MSVC linker runs out of memory if we do not remove all debug information.
+ GYP_CONFIG += fastbuild=2
+} else {
+ # Chromium builds with debug info in release by default but Qt doesn't
+ CONFIG(release, debug|release):!force_debug_info: GYP_CONFIG += fastbuild=1
+}
+
msvc {
equals(MSVC_VER, 12.0) {
MSVS_VERSION = 2013
@@ -60,16 +66,8 @@ msvc {
GYP_ARGS += "-G msvs_version=$$MSVS_VERSION"
- # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
- # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
- # is building for, not the system's actual architecture.
- PROGRAM_FILES_X86 = $$(ProgramW6432)
- isEmpty(PROGRAM_FILES_X86): GYP_ARGS += "-D windows_sdk_path=\"C:/Program Files/Windows Kits/8.1\""
+ isBuildingOnWin32(): GYP_ARGS += "-D windows_sdk_path=\"C:/Program Files/Windows Kits/8.1\""
- contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
- # The 32 bit MSVC linker runs out of memory if we do not remove all debug information.
- GYP_CONFIG += fastbuild=2
- }
} else {
fatal("Qt WebEngine for Windows can only be built with the Microsoft Visual Studio C++ compiler")
}
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 18f8dbadd..bff0557a8 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -38,6 +41,9 @@
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_restrictions.h"
+#if defined(ENABLE_SPELLCHECK)
+#include "chrome/browser/spellchecker/spellcheck_message_filter.h"
+#endif
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/child_process_security_policy.h"
@@ -61,6 +67,7 @@
#include "access_token_store_qt.h"
#include "browser_context_adapter.h"
#include "browser_context_qt.h"
+#include "browser_message_filter_qt.h"
#include "certificate_error_controller.h"
#include "certificate_error_controller_p.h"
#include "desktop_screen_qt.h"
@@ -69,8 +76,11 @@
#include "location_provider_qt.h"
#endif
#include "media_capture_devices_dispatcher.h"
+#if defined(ENABLE_BASIC_PRINTING)
+#include "printing_message_filter_qt.h"
+#endif // defined(ENABLE_BASIC_PRINTING)
#include "resource_dispatcher_host_delegate_qt.h"
-#include "user_script_controller_host.h"
+#include "user_resource_controller_host.h"
#include "web_contents_delegate_qt.h"
#include "web_engine_context.h"
#include "web_engine_library_info.h"
@@ -260,7 +270,8 @@ public:
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("cglcontextobj"), qtContext);
else if (platform == QLatin1String("qnx"))
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
- else if (platform == QLatin1String("eglfs") || platform == QLatin1String("wayland"))
+ else if (platform == QLatin1String("eglfs") || platform == QLatin1String("wayland")
+ || platform == QLatin1String("wayland-egl"))
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
else if (platform == QLatin1String("windows")) {
if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
@@ -280,7 +291,6 @@ public:
// We don't care about the rest, this context shouldn't be used except for its handle.
virtual bool Initialize(gfx::GLSurface *, gfx::GpuPreference) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
- virtual void Destroy() Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
virtual bool MakeCurrent(gfx::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
virtual void ReleaseCurrent(gfx::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
virtual bool IsCurrent(gfx::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
@@ -349,8 +359,18 @@ content::BrowserMainParts *ContentBrowserClientQt::CreateBrowserMainParts(const
void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost* host)
{
// FIXME: Add a settings variable to enable/disable the file scheme.
- content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(host->GetID(), url::kFileScheme);
- static_cast<BrowserContextQt*>(host->GetBrowserContext())->m_adapter->userScriptController()->renderProcessStartedWithHost(host);
+ const int id = host->GetID();
+ content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(id, url::kFileScheme);
+ static_cast<BrowserContextQt*>(host->GetBrowserContext())->m_adapter->userResourceController()->renderProcessStartedWithHost(host);
+#if defined(ENABLE_PEPPER_CDMS)
+ host->AddFilter(new BrowserMessageFilterQt(id));
+#endif
+#if defined(ENABLE_SPELLCHECK)
+ host->AddFilter(new SpellCheckMessageFilter(id));
+#endif
+#if defined(ENABLE_BASIC_PRINTING)
+ host->AddFilter(new PrintingMessageFilterQt(host->GetID()));
+#endif // defined(ENABLE_BASIC_PRINTING)
}
void ContentBrowserClientQt::ResourceDispatcherHostCreated()
@@ -384,7 +404,7 @@ content::AccessTokenStore *ContentBrowserClientQt::CreateAccessTokenStore()
net::URLRequestContextGetter* ContentBrowserClientQt::CreateRequestContext(content::BrowserContext* browser_context, content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors)
{
- return static_cast<BrowserContextQt*>(browser_context)->CreateRequestContext(protocol_handlers, request_interceptors.Pass());
+ return static_cast<BrowserContextQt*>(browser_context)->CreateRequestContext(protocol_handlers, std::move(request_interceptors));
}
content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionContext()
@@ -392,18 +412,19 @@ content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionCo
return new QuotaPermissionContextQt;
}
-void ContentBrowserClientQt::AllowCertificateError(int render_process_id, int render_frame_id, int cert_error,
- const net::SSLInfo& ssl_info, const GURL& request_url,
- content::ResourceType resource_type,
- bool overridable, bool strict_enforcement,
- bool expired_previous_decision,
- const base::Callback<void(bool)>& callback,
- content::CertificateRequestResultType* result)
+
+void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webContents,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& request_url,
+ content::ResourceType resource_type,
+ bool overridable,
+ bool strict_enforcement,
+ bool expired_previous_decision,
+ const base::Callback<void(bool)>& callback,
+ content::CertificateRequestResultType* result)
{
- content::RenderFrameHost *frameHost = content::RenderFrameHost::FromID(render_process_id, render_frame_id);
- WebContentsDelegateQt* contentsDelegate = 0;
- if (content::WebContents *webContents = frameHost->GetRenderViewHost()->GetDelegate()->GetAsWebContents())
- contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
+ WebContentsDelegateQt* contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
QSharedPointer<CertificateErrorController> errorController(new CertificateErrorController(new CertificateErrorControllerPrivate(cert_error, ssl_info, request_url, resource_type, overridable, strict_enforcement, callback)));
contentsDelegate->allowCertificateError(errorController);
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index eea7d2a22..1878e3d27 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -89,18 +92,16 @@ public:
virtual content::AccessTokenStore* CreateAccessTokenStore() Q_DECL_OVERRIDE;
virtual content::QuotaPermissionContext *CreateQuotaPermissionContext() Q_DECL_OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost *, content::WebPreferences *) Q_DECL_OVERRIDE;
- virtual void AllowCertificateError(
- int render_process_id,
- int render_frame_id,
- int cert_error,
- const net::SSLInfo& ssl_info,
- const GURL& request_url,
- content::ResourceType resource_type,
- bool overridable,
- bool strict_enforcement,
- bool expired_previous_decision,
- const base::Callback<void(bool)>& callback,
- content::CertificateRequestResultType* result) Q_DECL_OVERRIDE;
+ virtual void AllowCertificateError(content::WebContents* web_contents,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& request_url,
+ content::ResourceType resource_type,
+ bool overridable,
+ bool strict_enforcement,
+ bool expired_previous_decision,
+ const base::Callback<void(bool)>& callback,
+ content::CertificateRequestResultType* result) Q_DECL_OVERRIDE;
content::LocationProvider* OverrideSystemLocationProvider() Q_DECL_OVERRIDE;
content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() Q_DECL_OVERRIDE;
virtual net::URLRequestContextGetter *CreateRequestContext(content::BrowserContext *browser_context, content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptorss) Q_DECL_OVERRIDE;
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index c12abefc5..2afd8c3ae 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,9 +40,11 @@
#include "content_client_qt.h"
#include "base/command_line.h"
+#include "base/files/file_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/user_agent.h"
#include "ui/base/layout.h"
@@ -49,22 +54,65 @@
#include <QCoreApplication>
#include <QFile>
+#include <QLibraryInfo>
+#include <QString>
+
+#if defined(Q_OS_WIN)
+#include <shlobj.h>
+static QString getLocalAppDataDir()
+{
+ QString result;
+ wchar_t path[MAX_PATH];
+ if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE))
+ result = QDir::fromNativeSeparators(QString::fromWCharArray(path));
+ return result;
+}
+#endif
#if defined(ENABLE_PLUGINS)
+
+// The plugin logic is based on chrome/common/chrome_content_client.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
-static const int32 kPepperFlashPermissions = ppapi::PERMISSION_DEV |
- ppapi::PERMISSION_PRIVATE |
- ppapi::PERMISSION_BYPASS_USER_GESTURE |
- ppapi::PERMISSION_FLASH;
+#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
+
+static const int32_t kPepperFlashPermissions = ppapi::PERMISSION_DEV |
+ ppapi::PERMISSION_PRIVATE |
+ ppapi::PERMISSION_BYPASS_USER_GESTURE |
+ ppapi::PERMISSION_FLASH;
namespace switches {
const char kPpapiFlashPath[] = "ppapi-flash-path";
const char kPpapiFlashVersion[] = "ppapi-flash-version";
+const char kPpapiWidevinePath[] = "ppapi-widevine-path";
+}
+
+static const base::FilePath::CharType kWidevineCdmBaseDirectory[] = FILE_PATH_LITERAL("WidevineCDM");
+
+static const char kWidevineCdmPluginExtension[] = "";
+
+static const int32_t kWidevineCdmPluginPermissions = ppapi::PERMISSION_DEV
+ | ppapi::PERMISSION_PRIVATE;
+
+static QString ppapiPluginsPath()
+{
+ // Look for plugins in /plugins/ppapi or application dir.
+ static bool initialized = false;
+ static QString potentialPluginsPath = QLibraryInfo::location(QLibraryInfo::PluginsPath) % QLatin1String("/ppapi");
+ if (!initialized) {
+ initialized = true;
+ if (!QFileInfo::exists(potentialPluginsPath))
+ potentialPluginsPath = QCoreApplication::applicationDirPath();
+ }
+ return potentialPluginsPath;
}
-// Adopted from chrome_content_client.cc
+
content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, const std::string& version)
{
content::PepperPluginInfo plugin;
@@ -74,8 +122,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, cons
plugin.path = path;
plugin.permissions = kPepperFlashPermissions;
- std::vector<std::string> flash_version_numbers;
- base::SplitString(version, '.', &flash_version_numbers);
+ std::vector<std::string> flash_version_numbers = base::SplitString(version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
if (flash_version_numbers.size() < 1)
flash_version_numbers.push_back("11");
else if (flash_version_numbers[0].empty())
@@ -89,7 +136,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path, cons
// E.g., "Shockwave Flash 10.2 r154":
plugin.description = plugin.name + " " + flash_version_numbers[0] + "." + flash_version_numbers[1] + " r" + flash_version_numbers[2];
- plugin.version = JoinString(flash_version_numbers, '.');
+ plugin.version = base::JoinString(flash_version_numbers, ".");
content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType,
content::kFlashPluginSwfExtension,
content::kFlashPluginSwfDescription);
@@ -113,9 +160,11 @@ void AddPepperFlashFromSystem(std::vector<content::PepperPluginInfo>* plugins)
pluginDir.setFilter(QDir::Files);
Q_FOREACH (const QFileInfo &info, pluginDir.entryInfoList(QStringList("pepflashplayer*.dll")))
pluginPaths << info.absoluteFilePath();
+ pluginPaths << ppapiPluginsPath() + QStringLiteral("/pepflashplayer.dll");
#endif
#if defined(Q_OS_OSX)
pluginPaths << "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin"; // Mac OS X
+ pluginPaths << ppapiPluginsPath() + QStringLiteral("/PepperFlashPlayer.plugin");
#endif
#if defined(Q_OS_LINUX)
pluginPaths << "/opt/google/chrome/PepperFlash/libpepflashplayer.so" // Google Chrome
@@ -123,6 +172,7 @@ void AddPepperFlashFromSystem(std::vector<content::PepperPluginInfo>* plugins)
<< "/usr/lib/adobe-flashplugin/libpepflashplayer.so" // Ubuntu, package adobe-flashplugin
<< "/usr/lib/PepperFlash/libpepflashplayer.so" // Arch
<< "/usr/lib64/chromium/PepperFlash/libpepflashplayer.so"; // OpenSuSE
+ pluginPaths << ppapiPluginsPath() + QStringLiteral("/libpepflashplayer.so");
#endif
std::string flash_version = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kPpapiFlashVersion);
for (auto it = pluginPaths.constBegin(); it != pluginPaths.constEnd(); ++it) {
@@ -143,12 +193,91 @@ void AddPepperFlashFromCommandLine(std::vector<content::PepperPluginInfo>* plugi
plugins->push_back(CreatePepperFlashInfo(base::FilePath(flash_path), flash_version));
}
+void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins)
+{
+#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && !defined(WIDEVINE_CDM_IS_COMPONENT)
+ QStringList pluginPaths;
+ const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kPpapiWidevinePath);
+ if (!widevine_argument.empty())
+ pluginPaths << QtWebEngineCore::toQt(widevine_argument);
+ else {
+ pluginPaths << ppapiPluginsPath() + QStringLiteral("/") + QString::fromLatin1(kWidevineCdmAdapterFileName);
+#if defined(Q_OS_OSX)
+ QDir potentialWidevineDir(QDir::homePath() + "/Library/Application Support/Google/Chrome/WidevineCDM");
+ if (potentialWidevineDir.exists()) {
+ QFileInfoList widevineVersionDirs = potentialWidevineDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
+ for (int i = 0; i < widevineVersionDirs.size(); ++i) {
+ QString versionDirPath(widevineVersionDirs.at(i).absoluteFilePath());
+ QString potentialWidevinePluginPath = versionDirPath + "/_platform_specific/mac_x64/" + QString::fromLatin1(kWidevineCdmAdapterFileName);
+ pluginPaths << potentialWidevinePluginPath;
+ }
+ }
+#elif defined(Q_OS_WIN)
+ QDir potentialWidevineDir(getLocalAppDataDir() + "/Google/Chrome/User Data/WidevineCDM");
+ if (potentialWidevineDir.exists()) {
+ QFileInfoList widevineVersionDirs = potentialWidevineDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
+ for (int i = 0; i < widevineVersionDirs.size(); ++i) {
+ QString versionDirPath(widevineVersionDirs.at(i).absoluteFilePath());
+#ifdef WIN64
+ QString potentialWidevinePluginPath = versionDirPath + "/_platform_specific/win_x64/" + QString::fromLatin1(kWidevineCdmAdapterFileName);
+#else
+ QString potentialWidevinePluginPath = versionDirPath + "/_platform_specific/win_x86/" + QString::fromLatin1(kWidevineCdmAdapterFileName);
+#endif
+ pluginPaths << potentialWidevinePluginPath;
+ }
+ }
+#elif defined(Q_OS_LINUX)
+ pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdmadapter.so") // Google Chrome
+ << QStringLiteral("/usr/lib/chromium/libwidevinecdmadapter.so") // Arch
+ << QStringLiteral("/usr/lib64/chromium/libwidevinecdmadapter.so"); // OpenSUSE style
+#endif
+ }
+
+ Q_FOREACH (const QString &pluginPath, pluginPaths) {
+ base::FilePath path = QtWebEngineCore::toFilePath(pluginPath);
+ if (base::PathExists(path)) {
+ content::PepperPluginInfo widevine_cdm;
+ widevine_cdm.is_out_of_process = true;
+ widevine_cdm.path = path;
+ widevine_cdm.name = kWidevineCdmDisplayName;
+ widevine_cdm.description = kWidevineCdmDescription;
+ content::WebPluginMimeType widevine_cdm_mime_type(
+ kWidevineCdmPluginMimeType,
+ kWidevineCdmPluginExtension,
+ kWidevineCdmPluginMimeTypeDescription);
+
+ // Add the supported codecs as if they came from the component manifest.
+ std::vector<std::string> codecs;
+ codecs.push_back(kCdmSupportedCodecVorbis);
+ codecs.push_back(kCdmSupportedCodecVp8);
+ codecs.push_back(kCdmSupportedCodecVp9);
+#if defined(USE_PROPRIETARY_CODECS)
+ codecs.push_back(kCdmSupportedCodecAac);
+ codecs.push_back(kCdmSupportedCodecAvc1);
+#endif // defined(USE_PROPRIETARY_CODECS)
+ std::string codec_string =
+ base::JoinString(codecs, ",");
+ widevine_cdm_mime_type.additional_param_names.push_back(
+ base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
+ widevine_cdm_mime_type.additional_param_values.push_back(
+ base::ASCIIToUTF16(codec_string));
+
+ widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
+ widevine_cdm.permissions = kWidevineCdmPluginPermissions;
+ plugins->push_back(widevine_cdm);
+ }
+ }
+#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
+ // !defined(WIDEVINE_CDM_IS_COMPONENT)
+}
+
namespace QtWebEngineCore {
void ContentClientQt::AddPepperPlugins(std::vector<content::PepperPluginInfo>* plugins)
{
AddPepperFlashFromSystem(plugins);
AddPepperFlashFromCommandLine(plugins);
+ AddPepperWidevine(plugins);
}
}
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index 309e049dc..6a5584cc7 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 709246210..8bd07ef75 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -68,6 +71,30 @@ static base::StringPiece PlatformResourceProvider(int key) {
return base::StringPiece();
}
+// Logging logic is based on chrome/common/logging_chrome.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+static logging::LoggingDestination DetermineLogMode(const base::CommandLine& command_line)
+{
+#ifdef NDEBUG
+ bool enable_logging = false;
+ const char *kInvertLoggingSwitch = switches::kEnableLogging;
+#else
+ bool enable_logging = true;
+ const char *kInvertLoggingSwitch = switches::kDisableLogging;
+#endif
+
+ if (command_line.HasSwitch(kInvertLoggingSwitch))
+ enable_logging = !enable_logging;
+
+ if (enable_logging)
+ return logging::LOG_TO_SYSTEM_DEBUG_LOG;
+ else
+ return logging::LOG_NONE;
+}
+
void ContentMainDelegateQt::PreSandboxStartup()
{
#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
@@ -79,18 +106,19 @@ void ContentMainDelegateQt::PreSandboxStartup()
net::NetModule::SetResourceProvider(PlatformResourceProvider);
ui::ResourceBundle::InitSharedInstanceWithLocale(WebEngineLibraryInfo::getApplicationLocale(), 0, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
- // Suppress info, warning and error messages per default.
- int logLevel = logging::LOG_FATAL;
-
base::CommandLine* parsedCommandLine = base::CommandLine::ForCurrentProcess();
- if (parsedCommandLine->HasSwitch(switches::kLoggingLevel)) {
- std::string logLevelValue = parsedCommandLine->GetSwitchValueASCII(switches::kLoggingLevel);
- int level = 0;
- if (base::StringToInt(logLevelValue, &level) && level >= logging::LOG_INFO && level < logging::LOG_NUM_SEVERITIES)
- logLevel = level;
+ logging::LoggingSettings settings;
+ settings.logging_dest = DetermineLogMode(*parsedCommandLine);
+ logging::InitLogging(settings);
+
+ if (logging::GetMinLogLevel() >= logging::LOG_INFO) {
+ if (parsedCommandLine->HasSwitch(switches::kLoggingLevel)) {
+ std::string logLevelValue = parsedCommandLine->GetSwitchValueASCII(switches::kLoggingLevel);
+ int level = 0;
+ if (base::StringToInt(logLevelValue, &level) && level >= logging::LOG_INFO && level < logging::LOG_NUM_SEVERITIES)
+ logging::SetMinLogLevel(level);
+ }
}
-
- logging::SetMinLogLevel(logLevel);
}
content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient()
@@ -116,7 +144,9 @@ bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
PathService::Override(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA));
#endif
PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
-
+#if defined(ENABLE_SPELLCHECK)
+ PathService::Override(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));
+#endif
SetContentClient(new ContentClientQt);
return false;
}
diff --git a/src/core/content_main_delegate_qt.h b/src/core/content_main_delegate_qt.h
index f2f13d351..dd7f38f69 100644
--- a/src/core/content_main_delegate_qt.h
+++ b/src/core/content_main_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/cookie_monster_delegate_qt.cpp b/src/core/cookie_monster_delegate_qt.cpp
index 493743385..5a4c8e707 100644
--- a/src/core/cookie_monster_delegate_qt.cpp
+++ b/src/core/cookie_monster_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/cookie_monster_delegate_qt.h b/src/core/cookie_monster_delegate_qt.h
index c9f27c2bc..2ff5eeaa6 100644
--- a/src/core/cookie_monster_delegate_qt.h
+++ b/src/core/cookie_monster_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index ec180d38e..7351b108c 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -14,7 +14,6 @@ include(core_common.pri)
DEFINES += QT_NO_KEYWORDS \
QT_USE_QSTRINGBUILDER \
Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS \
- QTWEBENGINEPROCESS_NAME=\\\"$$QTWEBENGINEPROCESS_NAME\\\" \
QTWEBENGINECORE_VERSION_STR=\\\"$$MODULE_VERSION\\\" \
BUILDING_CHROMIUM
@@ -40,10 +39,13 @@ SOURCES = \
browser_accessibility_qt.cpp \
browser_context_adapter.cpp \
browser_context_qt.cpp \
+ browser_message_filter_qt.cpp \
certificate_error_controller.cpp \
chromium_gpu_helper.cpp \
chromium_overrides.cpp \
clipboard_qt.cpp \
+ color_chooser_qt.cpp \
+ color_chooser_controller.cpp \
common/qt_messages.cpp \
common/user_script_data.cpp \
content_client_qt.cpp \
@@ -55,6 +57,7 @@ SOURCES = \
desktop_screen_qt.cpp \
dev_tools_http_handler_delegate_qt.cpp \
download_manager_delegate_qt.cpp \
+ favicon_manager.cpp \
file_picker_controller.cpp \
gl_context_qt.cpp \
gl_surface_qt.cpp \
@@ -75,10 +78,11 @@ SOURCES = \
renderer/pepper/pepper_flash_clipboard_message_filter_qt.cpp \
renderer/pepper/pepper_flash_renderer_host_qt.cpp \
renderer/pepper/pepper_host_factory_qt.cpp \
+ renderer/pepper/pepper_isolated_file_system_message_filter.cpp \
renderer/pepper/pepper_renderer_host_factory_qt.cpp \
renderer/render_frame_observer_qt.cpp \
renderer/render_view_observer_qt.cpp \
- renderer/user_script_controller.cpp \
+ renderer/user_resource_controller.cpp \
renderer/web_channel_ipc_transport.cpp \
resource_bundle_qt.cpp \
resource_context_qt.cpp \
@@ -91,8 +95,8 @@ SOURCES = \
url_request_custom_job.cpp \
url_request_custom_job_delegate.cpp \
url_request_qrc_job_qt.cpp \
+ user_resource_controller_host.cpp \
user_script.cpp \
- user_script_controller_host.cpp \
web_channel_ipc_transport_host.cpp \
web_contents_adapter.cpp \
web_contents_delegate_qt.cpp \
@@ -114,10 +118,14 @@ HEADERS = \
browser_context_adapter.h \
browser_context_adapter_client.h \
browser_context_qt.h \
+ browser_message_filter_qt.h \
certificate_error_controller_p.h \
certificate_error_controller.h \
chromium_overrides.h \
clipboard_qt.h \
+ color_chooser_qt.h \
+ color_chooser_controller_p.h \
+ color_chooser_controller.h \
common/qt_messages.h \
common/user_script_data.h \
content_client_qt.h \
@@ -130,6 +138,8 @@ HEADERS = \
dev_tools_http_handler_delegate_qt.h \
download_manager_delegate_qt.h \
chromium_gpu_helper.h \
+ favicon_manager_p.h \
+ favicon_manager.h \
file_picker_controller.h \
gl_context_qt.h \
gl_surface_qt.h \
@@ -151,10 +161,11 @@ HEADERS = \
renderer/pepper/pepper_flash_clipboard_message_filter_qt.h \
renderer/pepper/pepper_flash_renderer_host_qt.h \
renderer/pepper/pepper_host_factory_qt.h \
+ renderer/pepper/pepper_isolated_file_system_message_filter.h \
renderer/pepper/pepper_renderer_host_factory_qt.h \
renderer/render_frame_observer_qt.h \
renderer/render_view_observer_qt.h \
- renderer/user_script_controller.h \
+ renderer/user_resource_controller.h \
renderer/web_channel_ipc_transport.h \
resource_context_qt.h \
resource_dispatcher_host_delegate_qt.h \
@@ -166,8 +177,8 @@ HEADERS = \
url_request_custom_job.h \
url_request_custom_job_delegate.h \
url_request_qrc_job_qt.h \
+ user_resource_controller_host.h \
user_script.h \
- user_script_controller_host.h \
web_channel_ipc_transport_host.h \
web_contents_adapter.h \
web_contents_adapter_client.h \
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 559fbe484..3b9dab457 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -52,7 +52,8 @@ for(LOC, LOCALE_LIST) {
}
resources.files = $$REPACK_DIR/qtwebengine_resources.pak \
$$REPACK_DIR/qtwebengine_resources_100p.pak \
- $$REPACK_DIR/qtwebengine_resources_200p.pak
+ $$REPACK_DIR/qtwebengine_resources_200p.pak \
+ $$REPACK_DIR/qtwebengine_devtools_resources.pak
icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
@@ -88,29 +89,10 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
#
!use?(system_icu) {
- icudt2build.input = icu.files
- icudt2build.output = $$[QT_INSTALL_DATA/get]/resources/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
- icudt2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- icudt2build.name = COPY ${QMAKE_FILE_IN}
- icudt2build.CONFIG = no_link no_clean target_predeps
- QMAKE_EXTRA_COMPILERS += icudt2build
+ COPIES += icu
}
- resources2build.input = resources.files
- resources2build.output = $$[QT_INSTALL_DATA/get]/resources/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
- resources2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- resources2build.name = COPY ${QMAKE_FILE_IN}
- resources2build.CONFIG = no_link no_clean target_predeps
-
- QMAKE_EXTRA_COMPILERS += resources2build
-
- locales2build.input = locales.files
- locales2build.output = $$[QT_INSTALL_DATA/get]/translations/qtwebengine_locales/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
- locales2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- locales2build.name = COPY ${QMAKE_FILE_IN}
- locales2build.CONFIG = no_link no_clean target_predeps
-
- QMAKE_EXTRA_COMPILERS += locales2build
+ COPIES += resources locales
}
}
diff --git a/src/core/custom_protocol_handler.cpp b/src/core/custom_protocol_handler.cpp
index 5b58694a1..402df04ba 100644
--- a/src/core/custom_protocol_handler.cpp
+++ b/src/core/custom_protocol_handler.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/custom_protocol_handler.h b/src/core/custom_protocol_handler.h
index 8b6756715..38e17ffaf 100644
--- a/src/core/custom_protocol_handler.h
+++ b/src/core/custom_protocol_handler.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index 363814789..8d0b8166a 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -54,7 +57,6 @@
#include "base/message_loop/message_loop.h"
#include "base/bind.h"
#include "cc/output/delegated_frame_data.h"
-#include "cc/quads/checkerboard_draw_quad.h"
#include "cc/quads/debug_border_draw_quad.h"
#include "cc/quads/draw_quad.h"
#include "cc/quads/io_surface_draw_quad.h"
@@ -65,6 +67,10 @@
#include "cc/quads/tile_draw_quad.h"
#include "cc/quads/yuv_video_draw_quad.h"
#include "content/common/host_shared_bitmap_manager.h"
+#include "gpu/command_buffer/service/mailbox_manager.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_fence.h"
+
#include <QOpenGLContext>
#include <QOpenGLFunctions>
#include <QSGSimpleRectNode>
@@ -392,7 +398,6 @@ cc::ReturnedResource ResourceHolder::returnResource()
// ack directly from our rendering thread. At this point (in updatePaintNode) we know that
// a frame that was compositing any of those resources has already been swapped and we thus
// don't need to use this mechanism.
- returned.sync_point = 0;
returned.id = m_resource.id;
returned.count = m_importCount;
m_importCount = 0;
@@ -449,96 +454,8 @@ void DelegatedFrameNode::preprocess()
mailboxesToFetch.append(static_cast<MailboxTexture *>((*it)->texture()));
}
- if (!mailboxesToFetch.isEmpty()) {
- QMap<uint32, gfx::TransferableFence> transferredFences;
- {
- QMutexLocker lock(&m_mutex);
- base::MessageLoop *gpuMessageLoop = gpu_message_loop();
- gpu::SyncPointManager *syncPointManager = sync_point_manager();
-
- Q_FOREACH (MailboxTexture *mailboxTexture, mailboxesToFetch) {
- m_numPendingSyncPoints++;
- AddSyncPointCallbackOnGpuThread(gpuMessageLoop, syncPointManager, mailboxTexture->mailboxHolder().sync_point, base::Bind(&DelegatedFrameNode::syncPointRetired, this, &mailboxesToFetch));
- }
-
- m_mailboxesFetchedWaitCond.wait(&m_mutex);
- m_mailboxGLFences.swap(transferredFences);
- }
-
-#if defined(USE_X11)
- // Workaround when context is not shared QTBUG-48969
- // Make slow copy between two contexts.
- if (!m_contextShared) {
- QOpenGLContext *currentContext = QOpenGLContext::currentContext() ;
- QOpenGLContext *sharedContext = qt_gl_global_share_context();
-
- QSurface *surface = currentContext->surface();
- Q_ASSERT(m_offsurface);
- sharedContext->makeCurrent(m_offsurface.data());
- QOpenGLFunctions *funcs = sharedContext->functions();
-
- GLuint fbo = 0;
- funcs->glGenFramebuffers(1, &fbo);
-
- Q_FOREACH (MailboxTexture *mailboxTexture, mailboxesToFetch) {
- gfx::TransferableFence fence = transferredFences.take(mailboxTexture->mailboxHolder().sync_point);
- waitChromiumSync(&fence);
- deleteChromiumSync(&fence);
-
- // Read texture into QImage from shared context.
- // Switch to shared context.
- sharedContext->makeCurrent(m_offsurface.data());
- funcs = sharedContext->functions();
- QImage img(mailboxTexture->textureSize(), QImage::Format_RGBA8888_Premultiplied);
- funcs->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
- funcs->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mailboxTexture->m_textureId, 0);
- GLenum status = funcs->glCheckFramebufferStatus(GL_FRAMEBUFFER);
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- qWarning("fbo error, skipping slow copy...");
- continue;
- }
- funcs->glReadPixels(0, 0, mailboxTexture->textureSize().width(), mailboxTexture->textureSize().height(),
- GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
-
- // Restore current context.
- // Create texture from QImage in current context.
- currentContext->makeCurrent(surface);
- GLuint texture = 0;
- funcs = currentContext->functions();
- funcs->glGenTextures(1, &texture);
- funcs->glBindTexture(GL_TEXTURE_2D, texture);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mailboxTexture->textureSize().width(), mailboxTexture->textureSize().height(), 0,
- GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
- mailboxTexture->m_textureId = texture;
- mailboxTexture->m_ownsTexture = true;
- }
- // Cleanup allocated resources
- sharedContext->makeCurrent(m_offsurface.data());
- funcs = sharedContext->functions();
- funcs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
- funcs->glDeleteFramebuffers(1, &fbo);
- currentContext->makeCurrent(surface);
- } else
-#endif
- {
- // Tell GL to wait until Chromium is done generating resource textures on the GPU thread
- // for each mailbox. We can safely start referencing those textures onto geometries afterward.
- Q_FOREACH (MailboxTexture *mailboxTexture, mailboxesToFetch) {
- gfx::TransferableFence fence = transferredFences.take(mailboxTexture->mailboxHolder().sync_point);
- waitChromiumSync(&fence);
- deleteChromiumSync(&fence);
- }
- }
- // We transferred all sync point fences from Chromium,
- // destroy all the ones not referenced by one of our mailboxes without waiting.
- QMap<uint32, gfx::TransferableFence>::iterator end = transferredFences.end();
- for (QMap<uint32, gfx::TransferableFence>::iterator it = transferredFences.begin(); it != end; ++it)
- deleteChromiumSync(&*it);
- }
+ if (!mailboxesToFetch.isEmpty())
+ fetchAndSyncMailboxes(mailboxesToFetch);
// Then render any intermediate RenderPass in order.
typedef QPair<cc::RenderPassId, QSharedPointer<QSGLayer> > Pair;
@@ -612,10 +529,10 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
// parent, with the last one in the list being the root RenderPass, the one
// that we displayed to the user.
// All RenderPasses except the last one are rendered to an FBO.
- cc::RenderPass *rootRenderPass = frameData->render_pass_list.back();
+ cc::RenderPass *rootRenderPass = frameData->render_pass_list.back().get();
for (unsigned i = 0; i < frameData->render_pass_list.size(); ++i) {
- cc::RenderPass *pass = frameData->render_pass_list.at(i);
+ cc::RenderPass *pass = frameData->render_pass_list.at(i).get();
QSGNode *renderPassParent = 0;
if (pass != rootRenderPass) {
@@ -652,15 +569,7 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
}
switch (quad->material) {
- case cc::DrawQuad::CHECKERBOARD: {
- const cc::CheckerboardDrawQuad *cbquad = cc::CheckerboardDrawQuad::MaterialCast(quad);
- QSGSimpleRectNode *rectangleNode = new QSGSimpleRectNode;
-
- rectangleNode->setRect(toQt(quad->rect));
- rectangleNode->setColor(toQt(cbquad->color));
- currentLayerChain->appendChildNode(rectangleNode);
- break;
- } case cc::DrawQuad::RENDER_PASS: {
+ case cc::DrawQuad::RENDER_PASS: {
const cc::RenderPassDrawQuad *renderPassQuad = cc::RenderPassDrawQuad::MaterialCast(quad);
QSGTexture *layer = findRenderPassLayer(renderPassQuad->render_pass_id, m_sgObjects.renderPassLayers).data();
// cc::GLRenderer::DrawRenderPassQuad silently ignores missing render passes.
@@ -816,36 +725,129 @@ QSGTexture *DelegatedFrameNode::initAndHoldTexture(ResourceHolder *resource, boo
return m_sgObjects.textureStrongRefs.last().data();
}
-void DelegatedFrameNode::fetchTexturesAndUnlockQt(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch)
+void DelegatedFrameNode::fetchAndSyncMailboxes(QList<MailboxTexture *> &mailboxesToFetch)
{
- // Fetch texture IDs from the mailboxes while we're on the GPU thread, where the MailboxManager lives.
- gpu::gles2::MailboxManager *mailboxManager = mailbox_manager();
- Q_FOREACH (MailboxTexture *mailboxTexture, *mailboxesToFetch)
- mailboxTexture->fetchTexture(mailboxManager);
+ QList<gfx::TransferableFence> transferredFences;
+ {
+ QMutexLocker lock(&m_mutex);
+
+ gpu::SyncPointManager *syncPointManager = sync_point_manager();
+ if (!m_syncPointClient)
+ m_syncPointClient = syncPointManager->CreateSyncPointClientWaiter();
+ base::MessageLoop *gpuMessageLoop = gpu_message_loop();
+ Q_ASSERT(m_numPendingSyncPoints == 0);
+ m_numPendingSyncPoints = mailboxesToFetch.count();
+ auto it = mailboxesToFetch.constBegin();
+ auto end = mailboxesToFetch.constEnd();
+ for (; it != end; ++it) {
+ MailboxTexture *mailboxTexture = *it;
+ gpu::SyncToken &syncToken = mailboxTexture->mailboxHolder().sync_token;
+ if (syncToken.HasData()) {
+ scoped_refptr<gpu::SyncPointClientState> release_state =
+ syncPointManager->GetSyncPointClientState(syncToken.namespace_id(), syncToken.command_buffer_id());
+ if (release_state && !release_state->IsFenceSyncReleased(syncToken.release_count())) {
+ m_syncPointClient->WaitOutOfOrderNonThreadSafe(
+ release_state.get(), syncToken.release_count(),
+ gpuMessageLoop->task_runner(), base::Bind(&DelegatedFrameNode::pullTexture, this, mailboxTexture));
+ continue;
+ }
+ }
+ gpuMessageLoop->PostTask(FROM_HERE, base::Bind(&DelegatedFrameNode::pullTexture, this, mailboxTexture));
+ }
- // Pick fences that we can ask GL to wait for before trying to sample the mailbox texture IDs.
- QMap<uint32, gfx::TransferableFence> transferredFences = transferFences();
+ m_mailboxesFetchedWaitCond.wait(&m_mutex);
+ m_textureFences.swap(transferredFences);
+ }
- // Chromium provided everything we were waiting for, let Qt start rendering.
- QMutexLocker lock(&frameNode->m_mutex);
- Q_ASSERT(frameNode->m_mailboxGLFences.isEmpty());
- frameNode->m_mailboxGLFences.swap(transferredFences);
- frameNode->m_mailboxesFetchedWaitCond.wakeOne();
+ Q_FOREACH (gfx::TransferableFence sync, transferredFences) {
+ // We need to wait on the fences on the Qt current context, and
+ // can therefore not use GLFence routines that uses a different
+ // concept of current context.
+ waitChromiumSync(&sync);
+ deleteChromiumSync(&sync);
+ }
+
+#if defined(USE_X11)
+ // Workaround when context is not shared QTBUG-48969
+ // Make slow copy between two contexts.
+ if (!m_contextShared) {
+ QOpenGLContext *currentContext = QOpenGLContext::currentContext() ;
+ QOpenGLContext *sharedContext = qt_gl_global_share_context();
+
+ QSurface *surface = currentContext->surface();
+ Q_ASSERT(m_offsurface);
+ sharedContext->makeCurrent(m_offsurface.data());
+ QOpenGLFunctions *funcs = sharedContext->functions();
+
+ GLuint fbo = 0;
+ funcs->glGenFramebuffers(1, &fbo);
+
+ Q_FOREACH (MailboxTexture *mailboxTexture, mailboxesToFetch) {
+ // Read texture into QImage from shared context.
+ // Switch to shared context.
+ sharedContext->makeCurrent(m_offsurface.data());
+ funcs = sharedContext->functions();
+ QImage img(mailboxTexture->textureSize(), QImage::Format_RGBA8888_Premultiplied);
+ funcs->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+ funcs->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mailboxTexture->m_textureId, 0);
+ GLenum status = funcs->glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ qWarning("fbo error, skipping slow copy...");
+ continue;
+ }
+ funcs->glReadPixels(0, 0, mailboxTexture->textureSize().width(), mailboxTexture->textureSize().height(),
+ GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
+
+ // Restore current context.
+ // Create texture from QImage in current context.
+ currentContext->makeCurrent(surface);
+ GLuint texture = 0;
+ funcs = currentContext->functions();
+ funcs->glGenTextures(1, &texture);
+ funcs->glBindTexture(GL_TEXTURE_2D, texture);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ funcs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mailboxTexture->textureSize().width(), mailboxTexture->textureSize().height(), 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
+ mailboxTexture->m_textureId = texture;
+ mailboxTexture->m_ownsTexture = true;
+ }
+ // Cleanup allocated resources
+ sharedContext->makeCurrent(m_offsurface.data());
+ funcs = sharedContext->functions();
+ funcs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ funcs->glDeleteFramebuffers(1, &fbo);
+ currentContext->makeCurrent(surface);
+ }
+#endif
}
-void DelegatedFrameNode::syncPointRetired(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch)
+
+void DelegatedFrameNode::pullTexture(DelegatedFrameNode *frameNode, MailboxTexture *texture)
+{
+ gpu::gles2::MailboxManager *mailboxManager = mailbox_manager();
+ gpu::SyncToken &syncToken = texture->mailboxHolder().sync_token;
+ if (syncToken.HasData())
+ mailboxManager->PullTextureUpdates(syncToken);
+ texture->fetchTexture(mailboxManager);
+ if (!!gfx::GLContext::GetCurrent() && gfx::GLFence::IsSupported()) {
+ // Create a fence on the Chromium GPU-thread and context
+ gfx::GLFence *fence = gfx::GLFence::Create();
+ // But transfer it to something generic since we need to read it using Qt's OpenGL.
+ frameNode->m_textureFences.append(fence->Transfer());
+ delete fence;
+ }
+ if (--frameNode->m_numPendingSyncPoints == 0)
+ base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&DelegatedFrameNode::fenceAndUnlockQt, frameNode));
+}
+
+void DelegatedFrameNode::fenceAndUnlockQt(DelegatedFrameNode *frameNode)
{
- // The way that sync points are normally used by the GpuCommandBufferStub is that it asks
- // the GpuScheduler to resume the work of the associated GL command stream / context once
- // the sync point has been retired by the dependency's context. In other words, a produced
- // texture means that the mailbox can be consumed, but the texture itself isn't expected
- // to be ready until to control is given back to the GpuScheduler through the event loop.
- // Do the same for our implementation by posting a message to the event loop once the last
- // of our syncpoints has been retired (the syncpoint callback is called synchronously) and
- // only at this point we wake the Qt rendering thread.
QMutexLocker lock(&frameNode->m_mutex);
- if (!--frameNode->m_numPendingSyncPoints)
- base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&DelegatedFrameNode::fetchTexturesAndUnlockQt, frameNode, mailboxesToFetch));
+ // Signal preprocess() the textures are ready
+ frameNode->m_mailboxesFetchedWaitCond.wakeOne();
}
} // namespace QtWebEngineCore
diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h
index d888935b2..005f4c768 100644
--- a/src/core/delegated_frame_node.h
+++ b/src/core/delegated_frame_node.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,6 +43,8 @@
#include "base/memory/scoped_ptr.h"
#include "cc/quads/render_pass.h"
#include "cc/resources/transferable_resource.h"
+#include "gpu/command_buffer/service/sync_point_manager.h"
+#include "ui/gl/gl_fence.h"
#include <QMutex>
#include <QSGNode>
#include <QSharedData>
@@ -81,10 +86,11 @@ public:
void commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease, RenderWidgetHostViewQtDelegate *apiDelegate);
private:
+ void fetchAndSyncMailboxes(QList<MailboxTexture *> &mailboxesToFetch);
// Making those callbacks static bypasses base::Bind's ref-counting requirement
// of the this pointer when the callback is a method.
- static void fetchTexturesAndUnlockQt(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch);
- static void syncPointRetired(DelegatedFrameNode *frameNode, QList<MailboxTexture *> *mailboxesToFetch);
+ static void pullTexture(DelegatedFrameNode *frameNode, MailboxTexture *mailbox);
+ static void fenceAndUnlockQt(DelegatedFrameNode *frameNode);
ResourceHolder *findAndHoldResource(unsigned resourceId, QHash<unsigned, QSharedPointer<ResourceHolder> > &candidates);
QSGTexture *initAndHoldTexture(ResourceHolder *resource, bool quadIsAllOpaque, RenderWidgetHostViewQtDelegate *apiDelegate = 0);
@@ -96,9 +102,10 @@ private:
QVector<QSharedPointer<QSGTexture> > textureStrongRefs;
} m_sgObjects;
int m_numPendingSyncPoints;
- QMap<uint32, gfx::TransferableFence> m_mailboxGLFences;
QWaitCondition m_mailboxesFetchedWaitCond;
QMutex m_mutex;
+ QList<gfx::TransferableFence> m_textureFences;
+ scoped_ptr<gpu::SyncPointClient> m_syncPointClient;
#if defined(USE_X11)
bool m_contextShared;
QScopedPointer<QOffscreenSurface> m_offsurface;
diff --git a/src/core/desktop_screen_qt.cpp b/src/core/desktop_screen_qt.cpp
index 720cd1faf..0904aec59 100644
--- a/src/core/desktop_screen_qt.cpp
+++ b/src/core/desktop_screen_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/desktop_screen_qt.h b/src/core/desktop_screen_qt.h
index c9768d940..ec7fe2e32 100644
--- a/src/core/desktop_screen_qt.h
+++ b/src/core/desktop_screen_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/dev_tools_http_handler_delegate_qt.cpp b/src/core/dev_tools_http_handler_delegate_qt.cpp
index 793ed0981..f3ffcc86d 100644
--- a/src/core/dev_tools_http_handler_delegate_qt.cpp
+++ b/src/core/dev_tools_http_handler_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -184,7 +187,7 @@ scoped_ptr<DevToolsHttpHandler> createDevToolsHttpHandler()
}
scoped_ptr<DevToolsHttpHandler::ServerSocketFactory> factory(new TCPServerSocketFactory(delegate->bindAddress().toStdString(), delegate->port(), 1));
// Ownership of the delegate is taken over the devtools http handler.
- scoped_ptr<DevToolsHttpHandler> handler(new DevToolsHttpHandler(factory.Pass(), std::string(), delegate, base::FilePath(), base::FilePath(), std::string(), std::string()));
+ scoped_ptr<DevToolsHttpHandler> handler(new DevToolsHttpHandler(std::move(factory), std::string(), delegate, base::FilePath(), base::FilePath(), std::string(), std::string()));
DevToolsDiscoveryManager::GetInstance()->AddProvider(scoped_ptr<DevToolsDiscoveryManager::Provider>(new DevToolsDiscoveryProviderQt()));
return handler;
}
@@ -247,6 +250,11 @@ std::string DevToolsHttpHandlerDelegateQt::GetFrontendResource(const std::string
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
}
+content::DevToolsExternalAgentProxyDelegate* DevToolsHttpHandlerDelegateQt::HandleWebSocketConnection(const std::string&)
+{
+ return 0;
+}
+
base::DictionaryValue* DevToolsManagerDelegateQt::HandleCommand(DevToolsAgentHost *, base::DictionaryValue *)
{
return 0;
diff --git a/src/core/dev_tools_http_handler_delegate_qt.h b/src/core/dev_tools_http_handler_delegate_qt.h
index 0fe9ad0ce..96a34a45a 100644
--- a/src/core/dev_tools_http_handler_delegate_qt.h
+++ b/src/core/dev_tools_http_handler_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -69,6 +72,8 @@ public:
std::string GetFrontendResource(const std::string&) Q_DECL_OVERRIDE;
std::string GetPageThumbnailData(const GURL &url) Q_DECL_OVERRIDE;
+ content::DevToolsExternalAgentProxyDelegate* HandleWebSocketConnection(const std::string&) Q_DECL_OVERRIDE;
+
private:
QString m_bindAddress;
int m_port;
diff --git a/src/core/doc/src/qtwebenginecore-index.qdoc b/src/core/doc/src/qtwebenginecore-index.qdoc
index 49231c8f2..70af397ce 100644
--- a/src/core/doc/src/qtwebenginecore-index.qdoc
+++ b/src/core/doc/src/qtwebenginecore-index.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/core/doc/src/qtwebenginecore-module.qdoc b/src/core/doc/src/qtwebenginecore-module.qdoc
index d0224c834..6dc2478fc 100644
--- a/src/core/doc/src/qtwebenginecore-module.qdoc
+++ b/src/core/doc/src/qtwebenginecore-module.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -11,8 +11,8 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
@@ -20,7 +20,7 @@
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 6d29af76a..857af2e18 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -62,9 +65,15 @@ ASSERT_ENUMS_MATCH(content::DownloadItem::COMPLETE, BrowserContextAdapterClient:
ASSERT_ENUMS_MATCH(content::DownloadItem::CANCELLED, BrowserContextAdapterClient::DownloadCancelled)
ASSERT_ENUMS_MATCH(content::DownloadItem::INTERRUPTED, BrowserContextAdapterClient::DownloadInterrupted)
+ASSERT_ENUMS_MATCH(content::SAVE_PAGE_TYPE_UNKNOWN, BrowserContextAdapterClient::UnknownSavePageFormat)
+ASSERT_ENUMS_MATCH(content::SAVE_PAGE_TYPE_AS_ONLY_HTML, BrowserContextAdapterClient::SingleHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, BrowserContextAdapterClient::CompleteHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(content::SAVE_PAGE_TYPE_AS_MHTML, BrowserContextAdapterClient::MimeHtmlSaveFormat)
+
DownloadManagerDelegateQt::DownloadManagerDelegateQt(BrowserContextAdapter *contextAdapter)
: m_contextAdapter(contextAdapter)
, m_currentId(0)
+ , m_weakPtrFactory(this)
{
Q_ASSERT(m_contextAdapter);
}
@@ -147,6 +156,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(content::DownloadItem* i
item->GetReceivedBytes(),
mimeTypeString,
suggestedFilePath,
+ BrowserContextAdapterClient::UnknownSavePageFormat,
false /* accepted */
};
@@ -188,6 +198,58 @@ void DownloadManagerDelegateQt::GetSaveDir(content::BrowserContext* browser_cont
*skip_dir_check = true;
}
+void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_contents,
+ const base::FilePath &suggested_path,
+ const base::FilePath::StringType &default_extension,
+ bool can_save_as_complete,
+ const content::SavePackagePathPickedCallback &callback)
+{
+ Q_UNUSED(default_extension);
+ Q_UNUSED(can_save_as_complete);
+
+ QList<BrowserContextAdapterClient*> clients = m_contextAdapter->clients();
+ if (clients.isEmpty())
+ return;
+
+ const QString suggestedFileName
+ = QFileInfo(toQt(suggested_path.AsUTF8Unsafe())).completeBaseName()
+ + QStringLiteral(".mhtml");
+ const QDir defaultDownloadDirectory
+ = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+ const QString suggestedFilePath = defaultDownloadDirectory.absoluteFilePath(suggestedFileName);
+
+ BrowserContextAdapterClient::DownloadItemInfo info = {
+ m_currentId + 1,
+ toQt(web_contents->GetURL()),
+ content::DownloadItem::IN_PROGRESS,
+ 0, /* totalBytes */
+ 0, /* receivedBytes */
+ QStringLiteral("application/x-mimearchive"),
+ suggestedFilePath,
+ BrowserContextAdapterClient::MimeHtmlSaveFormat,
+ false /* accepted */
+ };
+
+ Q_FOREACH (BrowserContextAdapterClient *client, clients) {
+ client->downloadRequested(info);
+ if (info.accepted)
+ break;
+ }
+
+ if (!info.accepted)
+ return;
+
+ callback.Run(toFilePath(info.path), static_cast<content::SavePageType>(info.savePageFormat),
+ base::Bind(&DownloadManagerDelegateQt::savePackageDownloadCreated,
+ m_weakPtrFactory.GetWeakPtr()));
+}
+
+void DownloadManagerDelegateQt::savePackageDownloadCreated(content::DownloadItem *item)
+{
+ OnDownloadUpdated(item);
+ item->AddObserver(this);
+}
+
void DownloadManagerDelegateQt::OnDownloadUpdated(content::DownloadItem *download)
{
QList<BrowserContextAdapterClient*> clients = m_contextAdapter->clients();
@@ -200,6 +262,7 @@ void DownloadManagerDelegateQt::OnDownloadUpdated(content::DownloadItem *downloa
download->GetReceivedBytes(),
toQt(download->GetMimeType()),
QString(),
+ BrowserContextAdapterClient::UnknownSavePageFormat,
true /* accepted */
};
diff --git a/src/core/download_manager_delegate_qt.h b/src/core/download_manager_delegate_qt.h
index fea965749..e724b4e23 100644
--- a/src/core/download_manager_delegate_qt.h
+++ b/src/core/download_manager_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -38,6 +41,7 @@
#define DOWNLOAD_MANAGER_DELEGATE_QT_H
#include "content/public/browser/download_manager_delegate.h"
+#include <base/memory/weak_ptr.h>
#include <QtCore/qcompilerdetection.h> // Needed for Q_DECL_OVERRIDE
@@ -72,6 +76,12 @@ public:
base::FilePath* website_save_dir,
base::FilePath* download_save_dir,
bool* skip_dir_check) Q_DECL_OVERRIDE;
+ void ChooseSavePath(content::WebContents *web_contents,
+ const base::FilePath &suggested_path,
+ const base::FilePath::StringType &default_extension,
+ bool can_save_as_complete,
+ const content::SavePackagePathPickedCallback &callback) Q_DECL_OVERRIDE;
+
void cancelDownload(quint32 downloadId);
@@ -81,9 +91,11 @@ public:
private:
void cancelDownload(const content::DownloadTargetCallback& callback);
+ void savePackageDownloadCreated(content::DownloadItem *download);
BrowserContextAdapter *m_contextAdapter;
- uint64 m_currentId;
+ uint64_t m_currentId;
+ base::WeakPtrFactory<DownloadManagerDelegateQt> m_weakPtrFactory;
friend class DownloadManagerDelegateInstance;
DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegateQt);
diff --git a/src/core/favicon_manager.cpp b/src/core/favicon_manager.cpp
new file mode 100644
index 000000000..be8d17725
--- /dev/null
+++ b/src/core/favicon_manager.cpp
@@ -0,0 +1,409 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "favicon_manager.h"
+#include "favicon_manager_p.h"
+
+#include "type_conversion.h"
+#include "web_contents_adapter_client.h"
+#include "web_engine_settings.h"
+
+#include "base/bind.h"
+#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/web_contents.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/core/SkPixelRef.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace QtWebEngineCore {
+
+static inline bool isResourceUrl(const QUrl &url)
+{
+ return !url.scheme().compare(QLatin1String("qrc"));
+}
+
+static inline unsigned area(const QSize &size)
+{
+ return size.width() * size.height();
+}
+
+
+FaviconManagerPrivate::FaviconManagerPrivate(content::WebContents *webContents, WebContentsAdapterClient *viewClient)
+ : m_webContents(webContents)
+ , m_viewClient(viewClient)
+ , m_weakFactory(this)
+{
+}
+
+FaviconManagerPrivate::~FaviconManagerPrivate()
+{
+}
+
+int FaviconManagerPrivate::downloadIcon(const QUrl &url)
+{
+ static int fakeId = 0;
+ int id;
+
+ bool cached = m_icons.contains(url);
+ if (isResourceUrl(url) || cached) {
+ id = --fakeId;
+ m_pendingRequests.insert(id, url);
+ } else {
+ id = m_webContents->DownloadImage(
+ toGurl(url),
+ true, // is_favicon
+ 0, // no max size
+ false, // normal cache policy
+ base::Bind(&FaviconManagerPrivate::iconDownloadFinished, m_weakFactory.GetWeakPtr()));
+ }
+
+ Q_ASSERT(!m_inProgressRequests.contains(id));
+ m_inProgressRequests.insert(id, url);
+
+ return id;
+}
+
+void FaviconManagerPrivate::iconDownloadFinished(int id,
+ int status,
+ const GURL &url,
+ const std::vector<SkBitmap> &bitmaps,
+ const std::vector<gfx::Size> &original_bitmap_sizes)
+{
+ Q_UNUSED(status);
+ Q_UNUSED(url);
+ Q_UNUSED(original_bitmap_sizes);
+
+ storeIcon(id, toQIcon(bitmaps));
+}
+
+/* Pending requests are used to mark icons that are already downloaded (cached icons or icons
+ * stored in qrc). These requests are also stored in the m_inProgressRequests but the corresponding
+ * icons are stored in m_icons explicitly by this function. It is necessary to avoid
+ * m_inProgressRequests being emptied right before the next icon is added by a downloadIcon() call.
+ */
+void FaviconManagerPrivate::downloadPendingRequests()
+{
+ for (auto it = m_pendingRequests.cbegin(), end = m_pendingRequests.cend(); it != end; ++it) {
+ QIcon icon;
+
+ QUrl requestUrl = it.value();
+ if (isResourceUrl(requestUrl) && !m_icons.contains(requestUrl))
+ icon = QIcon(requestUrl.toString().remove(0, 3));
+
+ storeIcon(it.key(), icon);
+ }
+
+ m_pendingRequests.clear();
+}
+
+void FaviconManagerPrivate::storeIcon(int id, const QIcon &icon)
+{
+ Q_Q(FaviconManager);
+
+ // Icon download has been interrupted
+ if (m_inProgressRequests.isEmpty())
+ return;
+
+ Q_ASSERT(m_inProgressRequests.contains(id));
+
+ QUrl requestUrl = m_inProgressRequests[id];
+ FaviconInfo &faviconInfo = q->m_faviconInfoMap[requestUrl];
+
+ unsigned iconCount = 0;
+ if (!icon.isNull())
+ iconCount = icon.availableSizes().count();
+
+ if (iconCount > 0) {
+ m_icons.insert(requestUrl, icon);
+
+ faviconInfo.size = icon.availableSizes().at(0);
+ if (iconCount > 1) {
+ faviconInfo.multiSize = true;
+ unsigned bestArea = area(faviconInfo.size);
+ for (unsigned i = 1; i < iconCount; ++i) {
+ QSize iconSize = icon.availableSizes().at(i);
+ if (bestArea < area(iconSize)) {
+ faviconInfo.size = iconSize;
+ bestArea = area(iconSize);
+ }
+ }
+ }
+ } else if (id >= 0) {
+ // Reset size if icon cannot be downloaded
+ faviconInfo.size = QSize(0, 0);
+ }
+
+ m_inProgressRequests.remove(id);
+ if (m_inProgressRequests.isEmpty()) {
+ WebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool touchIconsEnabled = settings->testAttribute(WebEngineSettings::TouchIconsEnabled);
+
+ q->generateCandidateIcon(touchIconsEnabled);
+ const QUrl &iconUrl = q->candidateIconUrl(touchIconsEnabled);
+ propagateIcon(iconUrl);
+ }
+}
+
+void FaviconManagerPrivate::propagateIcon(const QUrl &iconUrl) const
+{
+ content::NavigationEntry *entry = m_webContents->GetController().GetVisibleEntry();
+ if (entry) {
+ content::FaviconStatus &favicon = entry->GetFavicon();
+ favicon.url = toGurl(iconUrl);
+ favicon.valid = true;
+ }
+
+ m_viewClient->iconChanged(iconUrl);
+}
+
+FaviconManager::FaviconManager(FaviconManagerPrivate *d)
+ : m_candidateCount(0)
+{
+ Q_ASSERT(d);
+ d_ptr.reset(d);
+
+ d->q_ptr = this;
+}
+
+FaviconManager::~FaviconManager()
+{
+}
+
+QIcon FaviconManager::getIcon(const QUrl &url) const
+{
+ Q_D(const FaviconManager);
+
+ if (url.isEmpty())
+ return m_candidateIcon;
+
+ if (!d->m_icons.contains(url))
+ return QIcon();
+
+ return d->m_icons[url];
+}
+
+FaviconInfo FaviconManager::getFaviconInfo(const QUrl &url) const
+{
+ Q_ASSERT(m_faviconInfoMap.contains(url));
+ return m_faviconInfoMap[url];
+}
+
+QList<FaviconInfo> FaviconManager::getFaviconInfoList(bool candidatesOnly) const
+{
+ QList<FaviconInfo> faviconInfoList = m_faviconInfoMap.values();
+
+ if (candidatesOnly) {
+ QMutableListIterator<FaviconInfo> it(faviconInfoList);
+ while (it.hasNext()) {
+ if (!it.next().candidate)
+ it.remove();
+ }
+ }
+
+ return faviconInfoList;
+}
+
+void FaviconManager::update(const QList<FaviconInfo> &candidates)
+{
+ Q_D(FaviconManager);
+ updateCandidates(candidates);
+
+ WebEngineSettings *settings = d->m_viewClient->webEngineSettings();
+ if (!settings->testAttribute(WebEngineSettings::AutoLoadIconsForPage)) {
+ d->m_viewClient->iconChanged(QUrl());
+ return;
+ }
+
+ bool touchIconsEnabled = settings->testAttribute(WebEngineSettings::TouchIconsEnabled);
+
+ const QList<FaviconInfo> &faviconInfoList = getFaviconInfoList(true /* candidates only */);
+ for (auto it = faviconInfoList.cbegin(), end = faviconInfoList.cend(); it != end; ++it) {
+ if (!touchIconsEnabled && it->type != FaviconInfo::Favicon)
+ continue;
+
+ if (it->isValid())
+ d->downloadIcon(it->url);
+ }
+
+ d->downloadPendingRequests();
+
+ // Reset icon if nothing was downloaded
+ if (d->m_inProgressRequests.isEmpty()) {
+ content::NavigationEntry *entry = d->m_webContents->GetController().GetVisibleEntry();
+ if (entry && !entry->GetFavicon().valid)
+ d->m_viewClient->iconChanged(QUrl());
+ }
+}
+
+void FaviconManager::updateCandidates(const QList<FaviconInfo> &candidates)
+{
+ m_candidateCount = candidates.count();
+ for (FaviconInfo candidateFaviconInfo : candidates) {
+ const QUrl &candidateUrl = candidateFaviconInfo.url;
+
+ if (!m_faviconInfoMap.contains(candidateUrl))
+ m_faviconInfoMap.insert(candidateUrl, candidateFaviconInfo);
+ else {
+ // The same icon can be used for more than one page with different types.
+ m_faviconInfoMap[candidateUrl].type = candidateFaviconInfo.type;
+ }
+
+ m_faviconInfoMap[candidateUrl].candidate = true;
+ }
+}
+
+void FaviconManager::resetCandidates()
+{
+ Q_D(FaviconManager);
+
+ // Interrupt in progress icon downloads
+ d->m_pendingRequests.clear();
+ d->m_inProgressRequests.clear();
+
+ m_candidateCount = 0;
+ m_candidateIcon = QIcon();
+ for (auto it = m_faviconInfoMap.begin(), end = m_faviconInfoMap.end(); it != end; ++it)
+ it->candidate = false;
+}
+
+bool FaviconManager::hasCandidate() const
+{
+ return (m_candidateCount > 0);
+}
+
+QUrl FaviconManager::candidateIconUrl(bool touchIconsEnabled) const
+{
+ QUrl iconUrl;
+ const QList<FaviconInfo> &faviconInfoList = getFaviconInfoList(true /* candidates only */);
+
+ unsigned bestArea = 0;
+ for (auto it = faviconInfoList.cbegin(), end = faviconInfoList.cend(); it != end; ++it) {
+ if (!touchIconsEnabled && it->type != FaviconInfo::Favicon)
+ continue;
+
+ if (it->isValid() && bestArea < area(it->size)) {
+ iconUrl = it->url;
+ bestArea = area(it->size);
+ }
+ }
+
+ return iconUrl;
+}
+
+void FaviconManager::generateCandidateIcon(bool touchIconsEnabled)
+{
+ Q_ASSERT(m_candidateCount);
+
+ m_candidateIcon = QIcon();
+ const QList<FaviconInfo> &faviconInfoList = getFaviconInfoList(true /* candidates only */);
+
+ for (auto it = faviconInfoList.cbegin(), end = faviconInfoList.cend(); it != end; ++it) {
+ if (!touchIconsEnabled && it->type != FaviconInfo::Favicon)
+ continue;
+
+ if (!it->isValid() || !it->isDownloaded())
+ continue;
+
+ const QIcon &icon = getIcon(it->url);
+
+ if (!it->multiSize) {
+ if (!m_candidateIcon.availableSizes().contains(it->size))
+ m_candidateIcon.addPixmap(icon.pixmap(it->size));
+
+ continue;
+ }
+
+ const auto sizes = icon.availableSizes();
+ for (const QSize &size : sizes) {
+ if (!m_candidateIcon.availableSizes().contains(size))
+ m_candidateIcon.addPixmap(icon.pixmap(size));
+ }
+ }
+}
+
+
+FaviconInfo::FaviconInfo()
+ : url(QUrl())
+ , type(FaviconInfo::InvalidIcon)
+ , size(QSize(0, 0))
+ , candidate(false)
+ , multiSize(false)
+{
+}
+
+FaviconInfo::FaviconInfo(const FaviconInfo &other)
+ : url(other.url)
+ , type(other.type)
+ , size(other.size)
+ , candidate(other.candidate)
+ , multiSize(other.multiSize)
+{
+}
+
+FaviconInfo::FaviconInfo(const QUrl &url, FaviconInfo::FaviconType type)
+ : url(url)
+ , type(type)
+ , size(QSize(0, 0))
+ , candidate(false)
+ , multiSize(false)
+{
+}
+
+FaviconInfo::~FaviconInfo()
+{
+}
+
+bool FaviconInfo::isValid() const
+{
+ if (type == FaviconInfo::InvalidIcon)
+ return false;
+
+ if (url.isEmpty() || !url.isValid())
+ return false;
+
+ return true;
+}
+
+bool FaviconInfo::isDownloaded() const
+{
+ return area(size) > 0;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/favicon_manager.h b/src/core/favicon_manager.h
new file mode 100644
index 000000000..e351831c2
--- /dev/null
+++ b/src/core/favicon_manager.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FAVICON_MANAGER_H
+#define FAVICON_MANAGER_H
+
+#include "qtwebenginecoreglobal.h"
+
+#include <QtCore/QMap>
+#include <QtCore/QObject>
+#include <QtCore/QSize>
+#include <QtCore/QUrl>
+#include <QtGui/QIcon>
+
+#include "web_engine_settings.h"
+
+namespace QtWebEngineCore {
+
+class FaviconManagerPrivate;
+
+// Based on src/3rdparty/chromium/content/public/common/favicon_url.h
+class QWEBENGINE_EXPORT FaviconInfo {
+public:
+ enum FaviconType {
+ InvalidIcon,
+ Favicon,
+ TouchIcon,
+ TouchPrecomposedIcon
+ };
+
+ FaviconInfo();
+ FaviconInfo(const FaviconInfo &);
+ FaviconInfo(const QUrl &, FaviconInfo::FaviconType);
+ ~FaviconInfo();
+
+ bool isValid() const;
+ bool isDownloaded() const;
+
+ QUrl url;
+ FaviconType type;
+ // Stores the largest size in case of multi-size icon
+ QSize size;
+ bool candidate;
+ bool multiSize;
+};
+
+
+class QWEBENGINE_EXPORT FaviconManager : public QObject {
+ Q_OBJECT
+public:
+ ~FaviconManager();
+
+ QIcon getIcon(const QUrl &url = QUrl()) const;
+ FaviconInfo getFaviconInfo(const QUrl &) const;
+ QList<FaviconInfo> getFaviconInfoList(bool) const;
+
+private:
+ FaviconManager(FaviconManagerPrivate *);
+
+ void update(const QList<FaviconInfo> &);
+ void updateCandidates(const QList<FaviconInfo> &);
+ void resetCandidates();
+ bool hasCandidate() const;
+
+ QUrl candidateIconUrl(bool touchIconsEnabled) const;
+ void generateCandidateIcon(bool touchIconsEnabled);
+
+ QMap<QUrl, FaviconInfo> m_faviconInfoMap;
+ int m_candidateCount;
+ QIcon m_candidateIcon;
+
+ Q_DISABLE_COPY(FaviconManager)
+ Q_DECLARE_PRIVATE(FaviconManager)
+ QScopedPointer<FaviconManagerPrivate> d_ptr;
+
+ friend class WebContentsDelegateQt;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FAVICON_MANAGER_H
diff --git a/src/core/favicon_manager_p.h b/src/core/favicon_manager_p.h
new file mode 100644
index 000000000..e2a49dbc7
--- /dev/null
+++ b/src/core/favicon_manager_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FAVICON_MANAGER_P_H
+#define FAVICON_MANAGER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qtwebenginecoreglobal_p.h"
+
+#include <QtCore/QMap>
+#include <QtCore/QObject>
+#include <vector>
+
+#include "base/memory/weak_ptr.h"
+
+QT_FORWARD_DECLARE_CLASS(QUrl)
+
+class GURL;
+class SkBitmap;
+
+namespace gfx {
+ class Size;
+}
+
+namespace content {
+ class WebContents;
+}
+
+namespace QtWebEngineCore {
+
+class FaviconManager;
+class WebContentsAdapterClient;
+
+class FaviconManagerPrivate {
+public:
+ FaviconManagerPrivate(content::WebContents *, WebContentsAdapterClient *);
+ ~FaviconManagerPrivate();
+
+ int downloadIcon(const QUrl &);
+
+ void iconDownloadFinished(int, int, const GURL &, const std::vector<SkBitmap> &, const std::vector<gfx::Size> &);
+ void storeIcon(int, const QIcon &);
+ void downloadPendingRequests();
+ void propagateIcon(const QUrl &) const;
+
+ content::WebContents *m_webContents;
+ WebContentsAdapterClient *m_viewClient;
+ base::WeakPtrFactory<FaviconManagerPrivate> m_weakFactory;
+
+ QMap<QUrl, QIcon> m_icons;
+ QMap<int, QUrl> m_inProgressRequests;
+ QMap<int, QUrl> m_pendingRequests;
+
+ Q_DECLARE_PUBLIC(FaviconManager)
+ FaviconManager *q_ptr;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // FAVICON_MANAGER_P_H
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 18896c6b4..6c3889907 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -10,25 +10,28 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/file_picker_controller.h b/src/core/file_picker_controller.h
index 347dd11ef..6edee7713 100644
--- a/src/core/file_picker_controller.h
+++ b/src/core/file_picker_controller.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -10,25 +10,28 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp
index 3c3b8225d..0cf873631 100644
--- a/src/core/gl_context_qt.cpp
+++ b/src/core/gl_context_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/gl_context_qt.h b/src/core/gl_context_qt.h
index 5d6d522e6..2c04641d4 100644
--- a/src/core/gl_context_qt.h
+++ b/src/core/gl_context_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp
index e05021144..f499d853e 100644
--- a/src/core/gl_surface_qt.cpp
+++ b/src/core/gl_surface_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -97,7 +100,7 @@ public:
virtual bool Initialize() Q_DECL_OVERRIDE;
virtual void Destroy() Q_DECL_OVERRIDE;
virtual void* GetHandle() Q_DECL_OVERRIDE;
- virtual bool Resize(const gfx::Size &size) Q_DECL_OVERRIDE;
+ virtual bool Resize(const gfx::Size& size, float scale_factor, bool has_alpha) Q_DECL_OVERRIDE;
protected:
~GLSurfaceQtEGL();
@@ -119,7 +122,7 @@ public:
bool Initialize() Q_DECL_OVERRIDE;
void Destroy() Q_DECL_OVERRIDE;
bool IsSurfaceless() const Q_DECL_OVERRIDE;
- bool Resize(const gfx::Size& size) Q_DECL_OVERRIDE;
+ bool Resize(const gfx::Size& size, float scale_factor, bool has_alpha) Q_DECL_OVERRIDE;
EGLSurface GetHandle() Q_DECL_OVERRIDE;
void* GetShareHandle() Q_DECL_OVERRIDE;
@@ -410,6 +413,16 @@ bool GLSurfaceEGL::IsCreateContextRobustnessSupported()
return false;
}
+const char* GLSurfaceEGL::GetEGLExtensions()
+{
+ return g_extensions;
+}
+
+bool GLSurfaceEGL::HasEGLExtension(const char* name)
+{
+ return ExtensionsContain(GetEGLExtensions(), name);
+}
+
GLSurfaceQt::GLSurfaceQt(const gfx::Size& size)
: m_size(size)
{
@@ -486,7 +499,8 @@ gfx::Size GLSurfaceQt::GetSize()
return m_size;
}
-bool GLSurfaceQtEGL::Resize(const gfx::Size& size)
+
+bool GLSurfaceQtEGL::Resize(const gfx::Size& size, float scale_factor, bool has_alpha)
{
if (size == m_size)
return true;
@@ -545,7 +559,7 @@ bool GLSurfacelessQtEGL::IsSurfaceless() const
return true;
}
-bool GLSurfacelessQtEGL::Resize(const gfx::Size& size)
+bool GLSurfacelessQtEGL::Resize(const gfx::Size& size, float scale_factor, bool has_alpha)
{
m_size = size;
return true;
diff --git a/src/core/gl_surface_qt.h b/src/core/gl_surface_qt.h
index 7646063b2..33ea2a1da 100644
--- a/src/core/gl_surface_qt.h
+++ b/src/core/gl_surface_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro
index 30d62e0bf..4fab6cb97 100644
--- a/src/core/gyp_run.pro
+++ b/src/core/gyp_run.pro
@@ -16,8 +16,11 @@ cross_compile {
mac: include(config/mac_osx.pri)
win32: include(config/windows.pri)
}
-
+GYP_CONFIG += qtwe_process_name_debug=$$QTWEBENGINEPROCESS_NAME_DEBUG
+GYP_CONFIG += qtwe_process_name_release=$$QTWEBENGINEPROCESS_NAME_RELEASE
GYP_CONFIG += disable_glibcxx_debug=1
+!contains(QT_CONFIG, no-pkg-config): GYP_ARGS += "-D pkg-config=\"$$pkgConfigExecutable()\""
+
!webcore_debug: GYP_CONFIG += remove_webcore_debug_symbols=1
!v8base_debug: GYP_CONFIG += remove_v8base_debug_symbols=1
@@ -33,7 +36,7 @@ force_debug_info {
# Copy this logic from qt_module.prf so that ninja can run according
# to the same rules as the final module linking in core_module.pro.
!host_build:if(win32|mac):!macx-xcode {
- contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
+ contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
contains(QT_CONFIG, build_all):CONFIG += build_all
}
@@ -45,11 +48,11 @@ cross_compile {
# Needed for v8, see chromium/v8/build/toolchain.gypi
GYP_CONFIG += CXX=\"$$which($$QMAKE_CXX)\"
}
+else {
+ GYP_CONFIG += sysroot=\"\"
+}
contains(QT_ARCH, "arm") {
- # Chromium will set a default sysroot on arm unless we give it one.
- !cross_compile: GYP_CONFIG += sysroot=\"\"
-
GYP_CONFIG += target_arch=arm
# Extract ARM specific compiler options that we have to pass to gyp,
@@ -90,7 +93,6 @@ contains(QT_ARCH, "arm") {
}
contains(QT_ARCH, "mips") {
- !cross_compile: GYP_CONFIG += sysroot=\"\"
GYP_CONFIG += target_arch=mipsel
MARCH = $$extractCFlag("-march=.*")
@@ -114,6 +116,19 @@ contains(QT_ARCH, "arm64"): GYP_CONFIG += target_arch=arm64
contains(QT_ARCH, "mips64"): GYP_CONFIG += target_arch=mips64el
contains(WEBENGINE_CONFIG, use_proprietary_codecs): GYP_CONFIG += proprietary_codecs=1 ffmpeg_branding=Chrome
+contains(WEBENGINE_CONFIG, use_appstore_compliant_code): GYP_CONFIG += appstore_compliant_code=1
+
+# Compiling with -Os makes a huge difference in binary size, and the unwind tables is another big part,
+# but the latter are necessary for useful debug binaries.
+contains(WEBENGINE_CONFIG, reduce_binary_size): GYP_CONFIG += release_optimize=s debug_optimize=s release_unwind_tables=0
+
+contains(WEBENGINE_CONFIG, no_spellcheck): {
+ GYP_CONFIG += enable_spellcheck=0
+ osx: GYP_CONFIG += use_browser_spellchecker=0
+} else {
+ GYP_CONFIG += enable_spellcheck=1
+ osx: GYP_CONFIG += use_browser_spellchecker=1
+}
!contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) {
GYP_CONFIG += qt_install_data=\"$$[QT_INSTALL_DATA/get]\"
diff --git a/src/core/javascript_dialog_controller.cpp b/src/core/javascript_dialog_controller.cpp
index c87a61405..5b695b6cf 100644
--- a/src/core/javascript_dialog_controller.cpp
+++ b/src/core/javascript_dialog_controller.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/javascript_dialog_controller.h b/src/core/javascript_dialog_controller.h
index 8e1f86cd1..1cfdfa437 100644
--- a/src/core/javascript_dialog_controller.h
+++ b/src/core/javascript_dialog_controller.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/javascript_dialog_controller_p.h b/src/core/javascript_dialog_controller_p.h
index 5c3bd39f5..45c5a9fdd 100644
--- a/src/core/javascript_dialog_controller_p.h
+++ b/src/core/javascript_dialog_controller_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/javascript_dialog_manager_qt.cpp b/src/core/javascript_dialog_manager_qt.cpp
index 24d426098..80a28fb56 100644
--- a/src/core/javascript_dialog_manager_qt.cpp
+++ b/src/core/javascript_dialog_manager_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -49,7 +52,7 @@ Q_STATIC_ASSERT_X(static_cast<int>(content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) == s
JavaScriptDialogManagerQt *JavaScriptDialogManagerQt::GetInstance()
{
- return Singleton<JavaScriptDialogManagerQt>::get();
+ return base::Singleton<JavaScriptDialogManagerQt>::get();
}
void JavaScriptDialogManagerQt::RunJavaScriptDialog(content::WebContents *webContents, const GURL &originUrl, const std::string &acceptLang, content::JavaScriptMessageType javascriptMessageType, const base::string16 &messageText, const base::string16 &defaultPromptText, const content::JavaScriptDialogManager::DialogClosedCallback &callback, bool *didSuppressMessage)
@@ -64,7 +67,7 @@ void JavaScriptDialogManagerQt::RunJavaScriptDialog(content::WebContents *webCon
}
WebContentsAdapterClient::JavascriptDialogType dialogType = static_cast<WebContentsAdapterClient::JavascriptDialogType>(javascriptMessageType);
- runDialogForContents(webContents, dialogType, toQt(messageText).toHtmlEscaped(), toQt(defaultPromptText).toHtmlEscaped(), toQt(originUrl), callback);
+ runDialogForContents(webContents, dialogType, toQt(messageText).toHtmlEscaped(), toQt(defaultPromptText).toHtmlEscaped(), toQt(originUrl.GetOrigin()), callback);
}
void JavaScriptDialogManagerQt::RunBeforeUnloadDialog(content::WebContents *webContents, const base::string16 &messageText,
diff --git a/src/core/javascript_dialog_manager_qt.h b/src/core/javascript_dialog_manager_qt.h
index fb47166c1..aea5a5ec3 100644
--- a/src/core/javascript_dialog_manager_qt.h
+++ b/src/core/javascript_dialog_manager_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp
index 7184ca12a..c07bd4b0c 100644
--- a/src/core/location_provider_qt.cpp
+++ b/src/core/location_provider_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/location_provider_qt.h b/src/core/location_provider_qt.h
index 66060479d..b35dcddf9 100644
--- a/src/core/location_provider_qt.h
+++ b/src/core/location_provider_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index dd9a24757..9683245a0 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -44,6 +47,7 @@
#include "javascript_dialog_manager_qt.h"
#include "type_conversion.h"
#include "web_contents_view_qt.h"
+#include "web_engine_settings.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/media/desktop_streams_registry.h"
@@ -54,6 +58,7 @@
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/origin_util.h"
#include "content/public/common/media_stream_request.h"
#include "media/audio/audio_manager_base.h"
#include "ui/base/l10n/l10n_util.h"
@@ -83,6 +88,7 @@ base::string16 getContentsUrl(content::WebContents *webContents)
return base::UTF8ToUTF16(webContents->GetURL().GetOrigin().spec());
}
+// Based on chrome/browser/media/desktop_capture_access_handler.cc:
scoped_ptr<content::MediaStreamUI> getDevicesForDesktopCapture(content::MediaStreamDevices &devices, content::DesktopMediaID mediaId
, bool captureAudio, bool /*display_notification*/, base::string16 /*application_title*/)
{
@@ -98,7 +104,7 @@ scoped_ptr<content::MediaStreamUI> getDevicesForDesktopCapture(content::MediaStr
media::AudioManagerBase::kLoopbackInputDeviceId, "System Audio"));
}
- return ui.Pass();
+ return std::move(ui);
}
WebContentsAdapterClient::MediaRequestFlags mediaRequestFlagsForRequest(const content::MediaStreamRequest &request)
@@ -158,7 +164,7 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
(request.video_type && authorizationFlags & WebContentsAdapterClient::MediaVideoCapture);
if (securityOriginsMatch && (microphoneRequested || webcamRequested)) {
switch (request.request_type) {
- case content::MEDIA_OPEN_DEVICE:
+ case content::MEDIA_OPEN_DEVICE_PEPPER_ONLY:
getDefaultDevices("", "", microphoneRequested, webcamRequested, &devices);
break;
case content::MEDIA_DEVICE_ACCESS:
@@ -188,7 +194,7 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
MediaCaptureDevicesDispatcher *MediaCaptureDevicesDispatcher::GetInstance()
{
- return Singleton<MediaCaptureDevicesDispatcher>::get();
+ return base::Singleton<MediaCaptureDevicesDispatcher>::get();
}
MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher()
@@ -244,7 +250,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
scoped_ptr<content::MediaStreamUI> ui;
if (request.video_type != content::MEDIA_DESKTOP_VIDEO_CAPTURE) {
- callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, ui.Pass());
+ callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, std::move(ui));
return;
}
@@ -273,7 +279,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
// Received invalid device id.
if (mediaId.type == content::DesktopMediaID::TYPE_NONE) {
- callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, ui.Pass());
+ callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, std::move(ui));
return;
}
@@ -285,7 +291,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
devices, mediaId, capture_audio, true,
getContentsUrl(webContents));
- callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, ui.Pass());
+ callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, std::move(ui));
}
void MediaCaptureDevicesDispatcher::processScreenCaptureAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request
@@ -293,10 +299,10 @@ void MediaCaptureDevicesDispatcher::processScreenCaptureAccessRequest(content::W
{
DCHECK_EQ(request.video_type, content::MEDIA_DESKTOP_VIDEO_CAPTURE);
- // FIXME: expose through the settings once we have them
- const bool screenCaptureEnabled = !qgetenv("QT_WEBENGINE_USE_EXPERIMENTAL_SCREEN_CAPTURE").isNull();
+ WebContentsAdapterClient *adapterClient = WebContentsViewQt::from(static_cast<content::WebContentsImpl*>(webContents)->GetView())->client();
+ const bool screenCaptureEnabled = adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
- const bool originIsSecure = request.security_origin.SchemeIsSecure();
+ const bool originIsSecure = content::IsOriginSecure(request.security_origin);
if (screenCaptureEnabled && originIsSecure) {
@@ -335,7 +341,7 @@ void MediaCaptureDevicesDispatcher::handleScreenCaptureAccessRequest(content::We
content::MediaResponseCallback callback = queue.front().callback;
queue.pop_front();
- callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, ui.Pass());
+ callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, std::move(ui));
}
void MediaCaptureDevicesDispatcher::enqueueMediaAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request
diff --git a/src/core/media_capture_devices_dispatcher.h b/src/core/media_capture_devices_dispatcher.h
index 500fe7644..b13a9da2c 100644
--- a/src/core/media_capture_devices_dispatcher.h
+++ b/src/core/media_capture_devices_dispatcher.h
@@ -1,8 +1,8 @@
/****************************************************************************
**
** Copyright (c) 2012 The Chromium Authors. All rights reserved.
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -12,24 +12,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -84,7 +87,7 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
DesktopStreamsRegistry *getDesktopStreamsRegistry();
private:
- friend struct DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
+ friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
struct PendingAccessRequest {
PendingAccessRequest(const content::MediaStreamRequest &request,
diff --git a/src/core/native_web_keyboard_event_qt.cpp b/src/core/native_web_keyboard_event_qt.cpp
index d862f7353..2bb190ceb 100644
--- a/src/core/native_web_keyboard_event_qt.cpp
+++ b/src/core/native_web_keyboard_event_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp
index fd79917f4..ff0e8320c 100644
--- a/src/core/network_delegate_qt.cpp
+++ b/src/core/network_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -57,7 +60,7 @@ namespace QtWebEngineCore {
int pageTransitionToNavigationType(ui::PageTransition transition)
{
- int32 qualifier = ui::PageTransitionGetQualifier(transition);
+ int32_t qualifier = ui::PageTransitionGetQualifier(transition);
if (qualifier & ui::PAGE_TRANSITION_FORWARD_BACK)
return WebContentsAdapterClient::BackForwardNavigation;
@@ -261,7 +264,11 @@ void NetworkDelegateQt::OnResponseStarted(net::URLRequest*)
{
}
-void NetworkDelegateQt::OnRawBytesRead(const net::URLRequest&, int)
+void NetworkDelegateQt::OnNetworkBytesReceived(net::URLRequest*, int64_t)
+{
+}
+
+void NetworkDelegateQt::OnNetworkBytesSent(net::URLRequest*, int64_t)
{
}
@@ -293,7 +300,12 @@ bool NetworkDelegateQt::OnCanEnablePrivacyMode(const GURL&, const GURL&) const
return false;
}
-bool NetworkDelegateQt::OnFirstPartyOnlyCookieExperimentEnabled() const
+bool NetworkDelegateQt::OnAreExperimentalCookieFeaturesEnabled() const
+{
+ return false;
+}
+
+bool NetworkDelegateQt::OnAreStrictSecureCookiesEnabled() const
{
return false;
}
diff --git a/src/core/network_delegate_qt.h b/src/core/network_delegate_qt.h
index 41b5b98b6..1324e0da3 100644
--- a/src/core/network_delegate_qt.h
+++ b/src/core/network_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -81,14 +84,16 @@ public:
virtual int OnHeadersReceived(net::URLRequest*, const net::CompletionCallback&, const net::HttpResponseHeaders*, scoped_refptr<net::HttpResponseHeaders>*, GURL*) override;
virtual void OnBeforeRedirect(net::URLRequest*, const GURL&) override;
virtual void OnResponseStarted(net::URLRequest*) override;
- virtual void OnRawBytesRead(const net::URLRequest&, int) override;
+ virtual void OnNetworkBytesReceived(net::URLRequest*, int64_t) override;
+ virtual void OnNetworkBytesSent(net::URLRequest *, int64_t) override;
virtual void OnCompleted(net::URLRequest*, bool) override;
virtual void OnPACScriptError(int, const base::string16&) override;
virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired(net::URLRequest*, const net::AuthChallengeInfo&, const AuthCallback&, net::AuthCredentials*) override;
virtual bool OnCanGetCookies(const net::URLRequest&, const net::CookieList&) override;
virtual bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& path) const override;
virtual bool OnCanEnablePrivacyMode(const GURL&, const GURL&) const override;
- virtual bool OnFirstPartyOnlyCookieExperimentEnabled() const override;
+ virtual bool OnAreExperimentalCookieFeaturesEnabled() const override;
+ virtual bool OnAreStrictSecureCookiesEnabled() const override;
virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest&, const GURL&, const GURL&) const override;
};
diff --git a/src/core/ozone_platform_eglfs.cpp b/src/core/ozone_platform_eglfs.cpp
index 834e41fdf..6fea4259e 100644
--- a/src/core/ozone_platform_eglfs.cpp
+++ b/src/core/ozone_platform_eglfs.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -45,6 +48,7 @@
#include "ui/events/ozone/events_ozone.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/ozone/common/native_display_delegate_ozone.h"
+#include "ui/ozone/common/stub_client_native_pixmap_factory.h"
#include "ui/ozone/common/stub_overlay_manager.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/cursor_factory_ozone.h"
@@ -88,6 +92,7 @@ public:
void Show() override { }
void Hide() override { }
void Close() override { }
+ void SetTitle(const base::string16&) override { }
void SetCapture() override { }
void ReleaseCapture() override { }
void ToggleFullscreen() override { }
@@ -97,7 +102,7 @@ public:
void SetCursor(PlatformCursor) override { }
void MoveCursorTo(const gfx::Point&) override { }
void ConfineCursorToBounds(const gfx::Rect&) override { }
-
+ PlatformImeController* GetPlatformImeController() override { return nullptr; }
// PlatformEventDispatcher:
bool CanDispatchEvent(const PlatformEvent& event) override;
uint32_t DispatchEvent(const PlatformEvent& event) override;
@@ -179,8 +184,17 @@ scoped_ptr<ui::NativeDisplayDelegate> OzonePlatformEglfs::CreateNativeDisplayDel
return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
}
+base::ScopedFD OzonePlatformEglfs::OpenClientNativePixmapDevice() const
+{
+ return base::ScopedFD();
+}
+
OzonePlatform* CreateOzonePlatformEglfs() { return new OzonePlatformEglfs; }
+ClientNativePixmapFactory* CreateClientNativePixmapFactoryEglfs() {
+ return CreateStubClientNativePixmapFactory();
+}
+
void OzonePlatformEglfs::InitializeUI() {
overlay_manager_.reset(new StubOverlayManager());
device_manager_ = CreateDeviceManager();
diff --git a/src/core/ozone_platform_eglfs.h b/src/core/ozone_platform_eglfs.h
index 69ff2508f..3a2dfbcf0 100644
--- a/src/core/ozone_platform_eglfs.h
+++ b/src/core/ozone_platform_eglfs.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -62,6 +65,7 @@ class OzonePlatformEglfs : public OzonePlatform {
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) override;
virtual scoped_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate() override;
+ virtual base::ScopedFD OpenClientNativePixmapDevice() const override;
virtual ui::InputController* GetInputController() override;
virtual scoped_ptr<ui::SystemInputInjector> CreateSystemInputInjector() override;
virtual ui::OverlayManagerOzone* GetOverlayManager() override;
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index f68cd9699..9603dc94c 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -52,10 +55,16 @@ BrowserContextAdapter::PermissionType toQt(content::PermissionType type)
switch (type) {
case content::PermissionType::GEOLOCATION:
return BrowserContextAdapter::GeolocationPermission;
+ case content::PermissionType::AUDIO_CAPTURE:
+ return BrowserContextAdapter::AudioCapturePermission;
+ case content::PermissionType::VIDEO_CAPTURE:
+ return BrowserContextAdapter::VideoCapturePermission;
case content::PermissionType::NOTIFICATIONS:
case content::PermissionType::MIDI_SYSEX:
case content::PermissionType::PUSH_MESSAGING:
case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
+ case content::PermissionType::MIDI:
+ case content::PermissionType::DURABLE_STORAGE:
case content::PermissionType::NUM:
break;
}
@@ -63,7 +72,8 @@ BrowserContextAdapter::PermissionType toQt(content::PermissionType type)
}
PermissionManagerQt::PermissionManagerQt()
- : m_subscriberCount(0)
+ : m_requestIdCount(0)
+ , m_subscriberIdCount(0)
{
}
@@ -84,7 +94,7 @@ void PermissionManagerQt::permissionRequestReply(const QUrl &origin, BrowserCont
} else
++it;
}
- Q_FOREACH (const Subscriber &subscriber, m_subscribers) {
+ Q_FOREACH (const RequestOrSubscription &subscriber, m_subscribers) {
if (subscriber.origin == origin && subscriber.type == type)
subscriber.callback.Run(status);
}
@@ -96,54 +106,70 @@ bool PermissionManagerQt::checkPermission(const QUrl &origin, BrowserContextAdap
return m_permissions.contains(key) && m_permissions[key];
}
-void PermissionManagerQt::RequestPermission(content::PermissionType permission,
+int PermissionManagerQt::RequestPermission(content::PermissionType permission,
content::RenderFrameHost *frameHost,
- int request_id,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback)
{
Q_UNUSED(user_gesture);
+ int request_id = ++m_requestIdCount;
BrowserContextAdapter::PermissionType permissionType = toQt(permission);
if (permissionType == BrowserContextAdapter::UnsupportedPermission) {
callback.Run(content::PERMISSION_STATUS_DENIED);
- return;
+ return kNoPendingOperation;
}
+ // Audio and video-capture should not come this way currently
+ Q_ASSERT(permissionType != BrowserContextAdapter::AudioCapturePermission
+ && permissionType != BrowserContextAdapter::VideoCapturePermission);
content::WebContents *webContents = frameHost->GetRenderViewHost()->GetDelegate()->GetAsWebContents();
WebContentsDelegateQt* contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
Q_ASSERT(contentsDelegate);
- Request request = {
- request_id,
+ RequestOrSubscription request = {
permissionType,
toQt(requesting_origin),
callback
};
- m_requests.append(request);
+ m_requests.insert(request_id, request);
if (permissionType == BrowserContextAdapter::GeolocationPermission)
contentsDelegate->requestGeolocationPermission(request.origin);
+ return request_id;
}
-void PermissionManagerQt::CancelPermissionRequest(content::PermissionType permission,
- content::RenderFrameHost *frameHost,
- int request_id,
- const GURL& requesting_origin)
+int PermissionManagerQt::RequestPermissions(const std::vector<content::PermissionType>& permissions,
+ content::RenderFrameHost* frameHost,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const base::Callback<void(const std::vector<content::PermissionStatus>&)>& callback)
{
+ NOTIMPLEMENTED() << "RequestPermissions has not been implemented in QtWebEngine";
+ Q_UNUSED(user_gesture);
Q_UNUSED(frameHost);
- const BrowserContextAdapter::PermissionType permissionType = toQt(permission);
- if (permissionType == BrowserContextAdapter::UnsupportedPermission)
- return;
- // Should we add API to cancel permissions in the UI level?
- const QUrl origin = toQt(requesting_origin);
- auto it = m_requests.begin();
- while (it != m_requests.end()) {
- if (it->id == request_id && it->type == permissionType && it->origin == origin) {
- m_requests.erase(it);
- return;
+ std::vector<content::PermissionStatus> result(permissions.size());
+ for (content::PermissionType permission : permissions) {
+ const BrowserContextAdapter::PermissionType permissionType = toQt(permission);
+ if (permissionType == BrowserContextAdapter::UnsupportedPermission)
+ result.push_back(content::PERMISSION_STATUS_DENIED);
+ else {
+ QPair<QUrl, BrowserContextAdapter::PermissionType> key(toQt(requesting_origin), permissionType);
+ // TODO: Request permission from UI
+ if (m_permissions.contains(key) && m_permissions[key])
+ result.push_back(content::PERMISSION_STATUS_GRANTED);
+ else
+ result.push_back(content::PERMISSION_STATUS_DENIED);
}
}
- qWarning() << "PermissionManagerQt::CancelPermissionRequest called on unknown request" << request_id << origin << permissionType;
+
+ callback.Run(result);
+ return kNoPendingOperation;
+}
+
+void PermissionManagerQt::CancelPermissionRequest(int request_id)
+{
+ // Should we add API to cancel permissions in the UI level?
+ m_requests.remove(request_id);
}
content::PermissionStatus PermissionManagerQt::GetPermissionStatus(
@@ -190,25 +216,20 @@ int PermissionManagerQt::SubscribePermissionStatusChange(
const GURL& /*embedding_origin*/,
const base::Callback<void(content::PermissionStatus)>& callback)
{
- Subscriber subscriber = {
- m_subscriberCount++,
+ int subscriber_id = ++m_subscriberIdCount;
+ RequestOrSubscription subscriber = {
toQt(permission),
toQt(requesting_origin),
callback
};
- m_subscribers.append(subscriber);
- return subscriber.id;
+ m_subscribers.insert(subscriber_id, subscriber);
+ return subscriber_id;
}
void PermissionManagerQt::UnsubscribePermissionStatusChange(int subscription_id)
{
- for (int i = 0; i < m_subscribers.count(); i++) {
- if (m_subscribers[i].id == subscription_id) {
- m_subscribers.removeAt(i);
- return;
- }
- }
- qWarning() << "PermissionManagerQt::UnsubscribePermissionStatusChange called on unknown subscription id" << subscription_id;
+ if (!m_subscribers.remove(subscription_id))
+ qWarning() << "PermissionManagerQt::UnsubscribePermissionStatusChange called on unknown subscription id" << subscription_id;
}
} // namespace QtWebEngineCore
diff --git a/src/core/permission_manager_qt.h b/src/core/permission_manager_qt.h
index d4f4262a9..ff35357d8 100644
--- a/src/core/permission_manager_qt.h
+++ b/src/core/permission_manager_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -57,19 +60,14 @@ public:
bool checkPermission(const QUrl &origin, PermissionType type);
// content::PermissionManager implementation:
- void RequestPermission(
+ int RequestPermission(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
- int request_id,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(content::PermissionStatus)>& callback) override;
- void CancelPermissionRequest(
- content::PermissionType permission,
- content::RenderFrameHost* render_frame_host,
- int request_id,
- const GURL& requesting_origin) override;
+ void CancelPermissionRequest(int request_id) override;
content::PermissionStatus GetPermissionStatus(
content::PermissionType permission,
@@ -81,6 +79,14 @@ public:
const GURL& requesting_origin,
const GURL& embedding_origin) override;
+ int RequestPermissions(
+ const std::vector<content::PermissionType>& permission,
+ content::RenderFrameHost* render_frame_host,
+ const GURL& requesting_origin,
+ bool user_gesture,
+ const base::Callback<void(
+ const std::vector<content::PermissionStatus>&)>& callback) override;
+
void RegisterPermissionUsage(
content::PermissionType permission,
const GURL& requesting_origin,
@@ -96,21 +102,15 @@ public:
private:
QHash<QPair<QUrl, PermissionType>, bool> m_permissions;
- struct Request {
- int id;
- PermissionType type;
- QUrl origin;
- base::Callback<void(content::PermissionStatus)> callback;
- };
- QVector<Request> m_requests;
- struct Subscriber {
- int id;
+ struct RequestOrSubscription {
PermissionType type;
QUrl origin;
base::Callback<void(content::PermissionStatus)> callback;
};
- int m_subscriberCount;
- QVector<Subscriber> m_subscribers;
+ QHash<int, RequestOrSubscription> m_requests;
+ QHash<int, RequestOrSubscription> m_subscribers;
+ int m_requestIdCount;
+ int m_subscriberIdCount;
};
diff --git a/src/core/print_view_manager_base_qt.cpp b/src/core/print_view_manager_base_qt.cpp
new file mode 100644
index 000000000..3e12901b9
--- /dev/null
+++ b/src/core/print_view_manager_base_qt.cpp
@@ -0,0 +1,521 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This is based on chrome/browser/printing/print_view_manager_base.cc:
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "print_view_manager_qt.h"
+
+#include "type_conversion.h"
+#include "web_engine_context.h"
+
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
+#include "base/timer/timer.h"
+#include "base/values.h"
+#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/printing/print_job.h"
+#include "chrome/browser/printing/print_job_manager.h"
+#include "chrome/browser/printing/printer_query.h"
+#include "components/printing/common/print_messages.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_types.h"
+#include "printing/pdf_metafile_skia.h"
+#include "printing/print_job_constants.h"
+#include "printing/printed_document.h"
+
+namespace QtWebEngineCore {
+
+PrintViewManagerBaseQt::~PrintViewManagerBaseQt()
+{
+}
+
+// PrintedPagesSource implementation.
+base::string16 PrintViewManagerBaseQt::RenderSourceName()
+{
+ return toString16(QLatin1String(""));
+}
+
+PrintViewManagerBaseQt::PrintViewManagerBaseQt(content::WebContents *contents)
+ : printing::PrintManager(contents)
+ , m_isInsideInnerMessageLoop(false)
+ , m_isExpectingFirstPage(false)
+ , m_didPrintingSucceed(false)
+ , m_printerQueriesQueue(WebEngineContext::current()->getPrintJobManager()->queue())
+{
+
+}
+
+void PrintViewManagerBaseQt::OnNotifyPrintJobEvent(
+ const printing::JobEventDetails& event_details) {
+ switch (event_details.type()) {
+ case printing::JobEventDetails::FAILED: {
+ TerminatePrintJob(true);
+
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_PRINT_JOB_RELEASED,
+ content::Source<content::WebContents>(web_contents()),
+ content::NotificationService::NoDetails());
+ break;
+ }
+ case printing::JobEventDetails::USER_INIT_DONE:
+ case printing::JobEventDetails::DEFAULT_INIT_DONE:
+ case printing::JobEventDetails::USER_INIT_CANCELED: {
+ NOTREACHED();
+ break;
+ }
+ case printing::JobEventDetails::ALL_PAGES_REQUESTED: {
+ break;
+ }
+ case printing::JobEventDetails::NEW_DOC:
+ case printing::JobEventDetails::NEW_PAGE:
+ case printing::JobEventDetails::PAGE_DONE:
+ case printing::JobEventDetails::DOC_DONE: {
+ // Don't care about the actual printing process.
+ break;
+ }
+ case printing::JobEventDetails::JOB_DONE: {
+ // Printing is done, we don't need it anymore.
+ // print_job_->is_job_pending() may still be true, depending on the order
+ // of object registration.
+ m_didPrintingSucceed = true;
+ ReleasePrintJob();
+
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_PRINT_JOB_RELEASED,
+ content::Source<content::WebContents>(web_contents()),
+ content::NotificationService::NoDetails());
+ break;
+ }
+ default: {
+ NOTREACHED();
+ break;
+ }
+ }
+}
+
+
+// content::WebContentsObserver implementation.
+// Cancels the print job.
+void PrintViewManagerBaseQt::NavigationStopped()
+{
+}
+
+// content::WebContentsObserver implementation.
+void PrintViewManagerBaseQt::DidStartLoading()
+{
+}
+
+// content::NotificationObserver implementation.
+void PrintViewManagerBaseQt::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ switch (type) {
+ case chrome::NOTIFICATION_PRINT_JOB_EVENT:
+ OnNotifyPrintJobEvent(*content::Details<printing::JobEventDetails>(details).ptr());
+ break;
+ default:
+ NOTREACHED();
+ break;
+
+ }
+}
+ // Terminates or cancels the print job if one was pending.
+void PrintViewManagerBaseQt::RenderProcessGone(base::TerminationStatus status)
+{
+ PrintManager::RenderProcessGone(status);
+ ReleasePrinterQuery();
+
+ if (!m_printJob.get())
+ return;
+
+ scoped_refptr<printing::PrintedDocument> document(m_printJob->document());
+ if (document.get()) {
+ // If IsComplete() returns false, the document isn't completely rendered.
+ // Since our renderer is gone, there's nothing to do, cancel it. Otherwise,
+ // the print job may finish without problem.
+ TerminatePrintJob(!document->IsComplete());
+ }
+}
+
+void PrintViewManagerBaseQt::ReleasePrinterQuery() {
+ if (!cookie_)
+ return;
+
+ int cookie = cookie_;
+ cookie_ = 0;
+
+ printing::PrintJobManager* printJobManager =
+ WebEngineContext::current()->getPrintJobManager();
+ // May be NULL in tests.
+ if (!printJobManager)
+ return;
+
+ scoped_refptr<printing::PrinterQuery> printerQuery;
+ printerQuery = m_printerQueriesQueue->PopPrinterQuery(cookie);
+ if (!printerQuery.get())
+ return;
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&printing::PrinterQuery::StopWorker, printerQuery.get()));
+}
+
+
+// content::WebContentsObserver implementation.
+bool PrintViewManagerBaseQt::OnMessageReceived(const IPC::Message& message)
+{
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(PrintViewManagerBaseQt, message)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError,
+ OnShowInvalidPrinterSettingsError);
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled || PrintManager::OnMessageReceived(message);
+}
+
+void PrintViewManagerBaseQt::StopWorker(int documentCookie) {
+ if (documentCookie <= 0)
+ return;
+ scoped_refptr<printing::PrinterQuery> printer_query =
+ m_printerQueriesQueue->PopPrinterQuery(documentCookie);
+ if (printer_query.get()) {
+ content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&printing::PrinterQuery::StopWorker,
+ printer_query));
+ }
+}
+
+
+// IPC handlers
+void PrintViewManagerBaseQt::OnDidPrintPage(
+ const PrintHostMsg_DidPrintPage_Params& params) {
+ if (!OpportunisticallyCreatePrintJob(params.document_cookie))
+ return;
+
+ printing::PrintedDocument* document = m_printJob->document();
+ if (!document || params.document_cookie != document->cookie()) {
+ // Out of sync. It may happen since we are completely asynchronous. Old
+ // spurious messages can be received if one of the processes is overloaded.
+ return;
+ }
+
+#if defined(OS_MACOSX)
+ const bool metafile_must_be_valid = true;
+#else
+ const bool metafile_must_be_valid = m_isExpectingFirstPage;
+ m_isExpectingFirstPage = false;
+#endif
+
+ // Only used when |metafile_must_be_valid| is true.
+ scoped_ptr<base::SharedMemory> shared_buf;
+ if (metafile_must_be_valid) {
+ if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
+ NOTREACHED() << "invalid memory handle";
+ web_contents()->Stop();
+ return;
+ }
+ shared_buf.reset(new base::SharedMemory(params.metafile_data_handle, true));
+ if (!shared_buf->Map(params.data_size)) {
+ NOTREACHED() << "couldn't map";
+ web_contents()->Stop();
+ return;
+ }
+ } else {
+ if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
+ NOTREACHED() << "unexpected valid memory handle";
+ web_contents()->Stop();
+ base::SharedMemory::CloseHandle(params.metafile_data_handle);
+ return;
+ }
+ }
+
+ scoped_ptr<printing::PdfMetafileSkia> metafile(new printing::PdfMetafileSkia);
+ if (metafile_must_be_valid) {
+ if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) {
+ NOTREACHED() << "Invalid metafile header";
+ web_contents()->Stop();
+ return;
+ }
+ }
+
+#if defined(OS_WIN) && !defined(TOOLKIT_QT)
+ if (metafile_must_be_valid) {
+ scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes(
+ reinterpret_cast<const unsigned char*>(shared_buf->memory()),
+ params.data_size);
+
+ document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf"));
+ m_printJob->StartPdfToEmfConversion(
+ bytes, params.page_size, params.content_area);
+ }
+#else
+ // Update the rendered document. It will send notifications to the listener.
+ document->SetPage(params.page_number,
+ std::move(metafile),
+#if defined(OS_WIN)
+ 1.0f, // shrink factor, needed on windows.
+#endif // defined(OS_WIN)
+ params.page_size,
+ params.content_area);
+
+ ShouldQuitFromInnerMessageLoop();
+#endif // defined (OS_WIN) && !defined(TOOLKIT_QT)
+}
+
+void PrintViewManagerBaseQt::OnShowInvalidPrinterSettingsError()
+{
+}
+
+bool PrintViewManagerBaseQt::CreateNewPrintJob(printing::PrintJobWorkerOwner* job) {
+ DCHECK(!m_isInsideInnerMessageLoop);
+
+ // Disconnect the current print_job_.
+ DisconnectFromCurrentPrintJob();
+
+ // We can't print if there is no renderer.
+ if (!web_contents()->GetRenderViewHost() ||
+ !web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
+ return false;
+ }
+
+ // Ask the renderer to generate the print preview, create the print preview
+ // view and switch to it, initialize the printer and show the print dialog.
+ DCHECK(!m_printJob.get());
+ DCHECK(job);
+ if (!job)
+ return false;
+
+ m_printJob = new printing::PrintJob();
+ m_printJob->Initialize(job, this, number_pages_);
+ m_registrar.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
+ content::Source<printing::PrintJob>(m_printJob.get()));
+ m_didPrintingSucceed = false;
+ return true;
+}
+
+void PrintViewManagerBaseQt::DisconnectFromCurrentPrintJob() {
+ // Make sure all the necessary rendered page are done. Don't bother with the
+ // return value.
+ bool result = RenderAllMissingPagesNow();
+
+ // Verify that assertion.
+ if (m_printJob.get() &&
+ m_printJob->document() &&
+ !m_printJob->document()->IsComplete()) {
+ DCHECK(!result);
+ // That failed.
+ TerminatePrintJob(true);
+ } else {
+ // DO NOT wait for the job to finish.
+ ReleasePrintJob();
+ }
+#if !defined(OS_MACOSX)
+ m_isExpectingFirstPage = true;
+#endif
+}
+
+void PrintViewManagerBaseQt::PrintingDone(bool success) {
+ if (!m_printJob.get())
+ return;
+ Send(new PrintMsg_PrintingDone(routing_id(), success));
+}
+
+void PrintViewManagerBaseQt::TerminatePrintJob(bool cancel) {
+ if (!m_printJob.get())
+ return;
+
+ if (cancel) {
+ // We don't need the metafile data anymore because the printing is canceled.
+ m_printJob->Cancel();
+ m_isInsideInnerMessageLoop = false;
+ } else {
+ DCHECK(!m_isInsideInnerMessageLoop);
+ DCHECK(!m_printJob->document() || m_printJob->document()->IsComplete());
+
+ // WebContents is either dying or navigating elsewhere. We need to render
+ // all the pages in an hurry if a print job is still pending. This does the
+ // trick since it runs a blocking message loop:
+ m_printJob->Stop();
+ }
+ ReleasePrintJob();
+}
+
+bool PrintViewManagerBaseQt::OpportunisticallyCreatePrintJob(int cookie)
+{
+ if (m_printJob.get())
+ return true;
+
+ if (!cookie) {
+ // Out of sync. It may happens since we are completely asynchronous. Old
+ // spurious message can happen if one of the processes is overloaded.
+ return false;
+ }
+
+ // The job was initiated by a script. Time to get the corresponding worker
+ // thread.
+ scoped_refptr<printing::PrinterQuery> queued_query = m_printerQueriesQueue->PopPrinterQuery(cookie);
+ if (!queued_query.get()) {
+ NOTREACHED();
+ return false;
+ }
+
+ if (!CreateNewPrintJob(queued_query.get())) {
+ // Don't kill anything.
+ return false;
+ }
+
+ // Settings are already loaded. Go ahead. This will set
+ // print_job_->is_job_pending() to true.
+ m_printJob->StartPrinting();
+ return true;
+}
+
+void PrintViewManagerBaseQt::ReleasePrintJob() {
+ if (!m_printJob.get())
+ return;
+
+ PrintingDone(m_didPrintingSucceed);
+
+ m_registrar.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
+ content::Source<printing::PrintJob>(m_printJob.get()));
+ m_printJob->DisconnectSource();
+ // Don't close the worker thread.
+ m_printJob = NULL;
+}
+
+// Requests the RenderView to render all the missing pages for the print job.
+// No-op if no print job is pending. Returns true if at least one page has
+// been requested to the renderer.
+bool PrintViewManagerBaseQt::RenderAllMissingPagesNow()
+{
+ if (!m_printJob.get() || !m_printJob->is_job_pending())
+ return false;
+
+ // We can't print if there is no renderer.
+ if (!web_contents() ||
+ !web_contents()->GetRenderViewHost() ||
+ !web_contents()->GetRenderViewHost()->IsRenderViewLive()) {
+ return false;
+ }
+
+ // Is the document already complete?
+ if (m_printJob->document() && m_printJob->document()->IsComplete()) {
+ m_didPrintingSucceed = true;
+ return true;
+ }
+
+ // WebContents is either dying or a second consecutive request to print
+ // happened before the first had time to finish. We need to render all the
+ // pages in an hurry if a print_job_ is still pending. No need to wait for it
+ // to actually spool the pages, only to have the renderer generate them. Run
+ // a message loop until we get our signal that the print job is satisfied.
+ // PrintJob will send a ALL_PAGES_REQUESTED after having received all the
+ // pages it needs. MessageLoop::current()->Quit() will be called as soon as
+ // print_job_->document()->IsComplete() is true on either ALL_PAGES_REQUESTED
+ // or in DidPrintPage(). The check is done in
+ // ShouldQuitFromInnerMessageLoop().
+ // BLOCKS until all the pages are received. (Need to enable recursive task)
+ if (!RunInnerMessageLoop()) {
+ // This function is always called from DisconnectFromCurrentPrintJob() so we
+ // know that the job will be stopped/canceled in any case.
+ return false;
+ }
+ return true;
+}
+
+bool PrintViewManagerBaseQt::RunInnerMessageLoop() {
+ // This value may actually be too low:
+ //
+ // - If we're looping because of printer settings initialization, the premise
+ // here is that some poor users have their print server away on a VPN over a
+ // slow connection. In this situation, the simple fact of opening the printer
+ // can be dead slow. On the other side, we don't want to die infinitely for a
+ // real network error. Give the printer 60 seconds to comply.
+ //
+ // - If we're looping because of renderer page generation, the renderer could
+ // be CPU bound, the page overly complex/large or the system just
+ // memory-bound.
+ static const int kPrinterSettingsTimeout = 60000;
+ base::OneShotTimer quit_timer;
+ quit_timer.Start(FROM_HERE,
+ base::TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
+ base::MessageLoop::current(), &base::MessageLoop::QuitWhenIdle);
+
+ m_isInsideInnerMessageLoop = true;
+
+ // Need to enable recursive task.
+ {
+ base::MessageLoop::ScopedNestableTaskAllower allow(
+ base::MessageLoop::current());
+ base::MessageLoop::current()->Run();
+ }
+
+ bool success = true;
+ if (m_isInsideInnerMessageLoop) {
+ // Ok we timed out. That's sad.
+ m_isInsideInnerMessageLoop = false;
+ success = false;
+ }
+
+ return success;
+}
+
+// Quits the current message loop if these conditions hold true: a document is
+// loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This
+// function is called in DidPrintPage() or on ALL_PAGES_REQUESTED
+// notification. The inner message loop is created was created by
+// RenderAllMissingPagesNow().
+void PrintViewManagerBaseQt::ShouldQuitFromInnerMessageLoop()
+{
+ // Look at the reason.
+ DCHECK(m_printJob->document());
+ if (m_printJob->document() &&
+ m_printJob->document()->IsComplete() &&
+ m_isInsideInnerMessageLoop) {
+ // We are in a message loop created by RenderAllMissingPagesNow. Quit from
+ // it.
+ base::MessageLoop::current()->QuitWhenIdle();
+ m_isInsideInnerMessageLoop = false;
+ }
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/print_view_manager_base_qt.h b/src/core/print_view_manager_base_qt.h
new file mode 100644
index 000000000..f1e001eee
--- /dev/null
+++ b/src/core/print_view_manager_base_qt.h
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PRINT_VIEW_MANAGER_BASE_QT_H
+#define PRINT_VIEW_MANAGER_BASE_QT_H
+
+#include "base/memory/ref_counted.h"
+#include "base/prefs/pref_member.h"
+#include "base/strings/string16.h"
+#include "components/printing/browser/print_manager.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+#include "printing/printed_pages_source.h"
+
+struct PrintHostMsg_DidPrintPage_Params;
+
+namespace content {
+class RenderViewHost;
+}
+
+namespace printing {
+class JobEventDetails;
+class MetafilePlayer;
+class PrintJob;
+class PrintJobWorkerOwner;
+class PrintQueriesQueue;
+}
+
+namespace QtWebEngineCore {
+class PrintViewManagerBaseQt
+ : public content::NotificationObserver
+ , public printing::PrintManager
+ , public printing::PrintedPagesSource
+{
+public:
+ ~PrintViewManagerBaseQt() override;
+
+ // PrintedPagesSource implementation.
+ base::string16 RenderSourceName() override;
+
+protected:
+ explicit PrintViewManagerBaseQt(content::WebContents*);
+
+ // content::WebContentsObserver implementation.
+ // Cancels the print job.
+ void NavigationStopped() override;
+
+ // Terminates or cancels the print job if one was pending.
+ void RenderProcessGone(base::TerminationStatus status) override;
+
+ // content::WebContentsObserver implementation.
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ // IPC Message handlers.
+ void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params);
+ void OnShowInvalidPrinterSettingsError();
+
+ // Processes a NOTIFY_PRINT_JOB_EVENT notification.
+ void OnNotifyPrintJobEvent(const printing::JobEventDetails& event_details);
+
+ int number_pages_; // Number of pages to print in the print job.
+ int cookie_;
+ scoped_ptr<base::DictionaryValue> m_printSettings;
+
+ // content::NotificationObserver implementation.
+ void Observe(int,
+ const content::NotificationSource&,
+ const content::NotificationDetails&) override;
+ void StopWorker(int document_cookie);
+
+ // In the case of Scripted Printing, where the renderer is controlling the
+ // control flow, print_job_ is initialized whenever possible. No-op is
+ // print_job_ is initialized.
+ bool OpportunisticallyCreatePrintJob(int cookie);
+
+ // Requests the RenderView to render all the missing pages for the print job.
+ // No-op if no print job is pending. Returns true if at least one page has
+ // been requested to the renderer.
+ bool RenderAllMissingPagesNow();
+
+ // Quits the current message loop if these conditions hold true: a document is
+ // loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This
+ // function is called in DidPrintPage() or on ALL_PAGES_REQUESTED
+ // notification. The inner message loop is created was created by
+ // RenderAllMissingPagesNow().
+ void ShouldQuitFromInnerMessageLoop();
+
+ bool RunInnerMessageLoop();
+
+ void TerminatePrintJob(bool cancel);
+ void PrintingDone(bool success);
+ void DisconnectFromCurrentPrintJob();
+
+ bool CreateNewPrintJob(printing::PrintJobWorkerOwner* job);
+ void ReleasePrintJob();
+ void ReleasePrinterQuery();
+
+private:
+ content::NotificationRegistrar m_registrar;
+ scoped_refptr<printing::PrintJob> m_printJob;
+
+ bool m_isInsideInnerMessageLoop;
+ bool m_isExpectingFirstPage;
+ bool m_didPrintingSucceed;
+ scoped_refptr<printing::PrintQueriesQueue> m_printerQueriesQueue;
+ // content::WebContentsObserver implementation.
+ void DidStartLoading() override;
+ DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBaseQt);
+};
+
+} // namespace QtWebEngineCore
+#endif // PRINT_VIEW_MANAGER_BASE_QT_H
+
diff --git a/src/core/print_view_manager_qt.cpp b/src/core/print_view_manager_qt.cpp
new file mode 100644
index 000000000..f657b8289
--- /dev/null
+++ b/src/core/print_view_manager_qt.cpp
@@ -0,0 +1,320 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "print_view_manager_qt.h"
+
+#include "type_conversion.h"
+#include "web_engine_context.h"
+
+#include <QtGui/QPageLayout>
+#include <QtGui/QPageSize>
+
+#include "base/values.h"
+#include "chrome/browser/printing/print_job_manager.h"
+#include "chrome/browser/printing/printer_query.h"
+#include "components/printing/common/print_messages.h"
+#include "content/public/browser/browser_thread.h"
+#include "printing/pdf_metafile_skia.h"
+#include "printing/print_job_constants.h"
+
+DEFINE_WEB_CONTENTS_USER_DATA_KEY(QtWebEngineCore::PrintViewManagerQt);
+
+namespace {
+static const qreal kMicronsToMillimeter = 1000.0f;
+
+static std::vector<char>
+GetStdVectorFromHandle(base::SharedMemoryHandle handle, uint32_t data_size) {
+ scoped_ptr<base::SharedMemory> shared_buf(
+ new base::SharedMemory(handle, true));
+
+ if (!shared_buf->Map(data_size)) {
+ return std::vector<char>();
+ }
+
+ char* data = static_cast<char*>(shared_buf->memory());
+ return std::vector<char>(data, data + data_size);
+}
+
+static scoped_refptr<base::RefCountedBytes>
+GetBytesFromHandle(base::SharedMemoryHandle handle, uint32_t data_size) {
+ scoped_ptr<base::SharedMemory> shared_buf(
+ new base::SharedMemory(handle, true));
+
+ if (!shared_buf->Map(data_size)) {
+ return NULL;
+ }
+
+ unsigned char* data = static_cast<unsigned char*>(shared_buf->memory());
+ std::vector<unsigned char> dataVector(data, data + data_size);
+ return base::RefCountedBytes::TakeVector(&dataVector);
+}
+
+// Write the PDF file to disk.
+static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
+ const base::FilePath& path) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
+ DCHECK_GT(data->size(), 0U);
+
+ printing::PdfMetafileSkia metafile;
+ metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
+
+ base::File file(path,
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ if (file.IsValid())
+ metafile.SaveTo(&file);
+}
+
+static base::DictionaryValue *createPrintSettings()
+{
+ base::DictionaryValue *printSettings = new base::DictionaryValue();
+ // TO DO: Check if we can use the request ID from Qt here somehow.
+ static int internalRequestId = 0;
+
+ printSettings->SetBoolean(printing::kIsFirstRequest, internalRequestId++ == 0);
+ printSettings->SetInteger(printing::kPreviewRequestID, internalRequestId);
+
+ // The following are standard settings that Chromium expects to be set.
+ printSettings->SetBoolean(printing::kSettingPrintToPDF, true);
+ printSettings->SetBoolean(printing::kSettingCloudPrintDialog, false);
+ printSettings->SetBoolean(printing::kSettingPrintWithPrivet, false);
+ printSettings->SetBoolean(printing::kSettingPrintWithExtension, false);
+
+ printSettings->SetBoolean(printing::kSettingGenerateDraftData, false);
+ printSettings->SetBoolean(printing::kSettingPreviewModifiable, false);
+ printSettings->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX);
+ printSettings->SetInteger(printing::kSettingCopies, 1);
+ printSettings->SetBoolean(printing::kSettingCollate, false);
+ printSettings->SetBoolean(printing::kSettingGenerateDraftData, false);
+ printSettings->SetBoolean(printing::kSettingPreviewModifiable, false);
+
+ printSettings->SetBoolean(printing::kSettingShouldPrintSelectionOnly, false);
+ printSettings->SetBoolean(printing::kSettingShouldPrintBackgrounds, true);
+ printSettings->SetBoolean(printing::kSettingHeaderFooterEnabled, false);
+ printSettings->SetString(printing::kSettingDeviceName, "");
+ printSettings->SetInteger(printing::kPreviewUIID, 12345678);
+
+ return printSettings;
+}
+
+static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayout &pageLayout)
+{
+ base::DictionaryValue *printSettings = createPrintSettings();
+
+ //Set page size attributes, chromium expects these in micrometers
+ QSizeF pageSizeInMilimeter = pageLayout.pageSize().size(QPageSize::Millimeter);
+ scoped_ptr<base::DictionaryValue> sizeDict(new base::DictionaryValue);
+ sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMilimeter.width() * kMicronsToMillimeter);
+ sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMilimeter.height() * kMicronsToMillimeter);
+ printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict));
+
+ // Apply page margins
+ QMargins pageMarginsInPoints = pageLayout.marginsPoints();
+ scoped_ptr<base::DictionaryValue> marginsDict(new base::DictionaryValue);
+ marginsDict->SetInteger(printing::kSettingMarginTop, pageMarginsInPoints.top());
+ marginsDict->SetInteger(printing::kSettingMarginBottom, pageMarginsInPoints.bottom());
+ marginsDict->SetInteger(printing::kSettingMarginLeft, pageMarginsInPoints.left());
+ marginsDict->SetInteger(printing::kSettingMarginRight, pageMarginsInPoints.right());
+ printSettings->Set(printing::kSettingMarginsCustom, std::move(marginsDict));
+ printSettings->SetInteger(printing::kSettingMarginsType, printing::CUSTOM_MARGINS);
+
+ printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
+
+ return printSettings;
+}
+
+} // namespace
+
+namespace QtWebEngineCore {
+
+PrintViewManagerQt::~PrintViewManagerQt()
+{
+}
+
+#if defined(ENABLE_BASIC_PRINTING)
+bool PrintViewManagerQt::PrintToPDF(const QPageLayout &pageLayout, const QString &filePath)
+{
+ if (m_printSettings || !filePath.length())
+ return false;
+
+ m_pdfOutputPath = toFilePath(filePath);
+ if (!PrintToPDFInternal(pageLayout)) {
+ resetPdfState();
+ return false;
+ }
+ return true;
+}
+
+bool PrintViewManagerQt::PrintToPDFWithCallback(const QPageLayout &pageLayout, const PrintToPDFCallback& callback)
+{
+ if (callback.is_null())
+ return false;
+
+ // If there already is a pending print in progress, don't try starting another one.
+ if (m_printSettings) {
+ content::BrowserThread::PostTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(callback, std::vector<char>()));
+ return false;
+ }
+
+ m_pdfPrintCallback = callback;
+ if (!PrintToPDFInternal(pageLayout)) {
+ content::BrowserThread::PostTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(callback, std::vector<char>()));
+
+ resetPdfState();
+ return false;
+ }
+ return true;
+}
+
+bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout)
+{
+ if (!pageLayout.isValid())
+ return false;
+ m_printSettings.reset(createPrintSettingsFromQPageLayout(pageLayout));
+
+ m_printSettings->SetInteger(printing::kSettingColor, printing::COLOR);
+ return Send(new PrintMsg_InitiatePrintPreview(routing_id(), false));
+}
+
+#endif // defined(ENABLE_BASIC_PRINTING)
+
+// PrintedPagesSource implementation.
+base::string16 PrintViewManagerQt::RenderSourceName()
+{
+ return toString16(QLatin1String(""));
+}
+
+PrintViewManagerQt::PrintViewManagerQt(content::WebContents *contents)
+ : PrintViewManagerBaseQt(contents)
+{
+
+}
+
+// content::WebContentsObserver implementation.
+bool PrintViewManagerQt::OnMessageReceived(const IPC::Message& message)
+{
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(PrintViewManagerQt, message)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DidShowPrintDialog, OnDidShowPrintDialog)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview,
+ OnRequestPrintPreview)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
+ OnMetafileReadyForPrinting);
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled || PrintManager::OnMessageReceived(message);
+}
+
+void PrintViewManagerQt::resetPdfState()
+{
+ m_pdfOutputPath.clear();
+ m_pdfPrintCallback.Reset();
+ m_printSettings.reset();
+}
+
+// IPC handlers
+
+void PrintViewManagerQt::OnRequestPrintPreview(
+ const PrintHostMsg_RequestPrintPreview_Params& params)
+{
+ Send(new PrintMsg_PrintPreview(routing_id(), *m_printSettings));
+}
+
+void PrintViewManagerQt::OnMetafileReadyForPrinting(
+ const PrintHostMsg_DidPreviewDocument_Params& params)
+{
+ StopWorker(params.document_cookie);
+
+ // Create local copies so we can reset the state and take a new pdf print job.
+ base::Callback<void(const std::vector<char>&)> pdf_print_callback = m_pdfPrintCallback;
+ base::FilePath pdfOutputPath = m_pdfOutputPath;
+
+ resetPdfState();
+
+ if (!pdf_print_callback.is_null()) {
+ std::vector<char> data_vector = GetStdVectorFromHandle(params.metafile_data_handle, params.data_size);
+ content::BrowserThread::PostTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(pdf_print_callback, data_vector));
+ } else {
+ scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params.metafile_data_handle, params.data_size);
+ content::BrowserThread::PostTask(content::BrowserThread::FILE,
+ FROM_HERE,
+ base::Bind(&SavePdfFile, data_bytes, pdfOutputPath));
+ }
+}
+
+void PrintViewManagerQt::OnDidShowPrintDialog()
+{
+}
+
+// content::WebContentsObserver implementation.
+void PrintViewManagerQt::DidStartLoading()
+{
+}
+
+// content::WebContentsObserver implementation.
+// Cancels the print job.
+void PrintViewManagerQt::NavigationStopped()
+{
+ if (!m_pdfPrintCallback.is_null()) {
+ content::BrowserThread::PostTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(m_pdfPrintCallback, std::vector<char>()));
+ }
+ resetPdfState();
+}
+
+void PrintViewManagerQt::RenderProcessGone(base::TerminationStatus status)
+{
+ PrintViewManagerBaseQt::RenderProcessGone(status);
+ if (!m_pdfPrintCallback.is_null()) {
+ content::BrowserThread::PostTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(m_pdfPrintCallback, std::vector<char>()));
+ }
+ resetPdfState();
+}
+
+
+} // namespace QtWebEngineCore
diff --git a/src/core/print_view_manager_qt.h b/src/core/print_view_manager_qt.h
new file mode 100644
index 000000000..88a499f1b
--- /dev/null
+++ b/src/core/print_view_manager_qt.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PRINT_VIEW_MANAGER_QT_H
+#define PRINT_VIEW_MANAGER_QT_H
+
+#include "print_view_manager_base_qt.h"
+
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include "base/memory/ref_counted.h"
+#include "base/prefs/pref_member.h"
+#include "base/strings/string16.h"
+#include "components/printing/browser/print_manager.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "printing/printed_pages_source.h"
+
+struct PrintHostMsg_RequestPrintPreview_Params;
+struct PrintHostMsg_DidPreviewDocument_Params;
+
+namespace content {
+class RenderViewHost;
+}
+
+namespace printing {
+class JobEventDetails;
+class MetafilePlayer;
+class PrintJob;
+class PrintJobWorkerOwner;
+class PrintQueriesQueue;
+}
+
+QT_BEGIN_NAMESPACE
+class QPageLayout;
+class QString;
+QT_END_NAMESPACE
+
+namespace QtWebEngineCore {
+class PrintViewManagerQt
+ : PrintViewManagerBaseQt
+ , public content::WebContentsUserData<PrintViewManagerQt>
+{
+public:
+ ~PrintViewManagerQt() override;
+ typedef base::Callback<void(const std::vector<char> &result)> PrintToPDFCallback;
+#if defined(ENABLE_BASIC_PRINTING)
+ // Method to print a page to a Pdf document with page size \a pageSize in location \a filePath.
+ bool PrintToPDF(const QPageLayout& pageLayout, const QString& filePath);
+ bool PrintToPDFWithCallback(const QPageLayout& pageLayout, const PrintToPDFCallback& callback);
+#endif // ENABLE_BASIC_PRINTING
+
+ // PrintedPagesSource implementation.
+ base::string16 RenderSourceName() override;
+
+protected:
+ explicit PrintViewManagerQt(content::WebContents*);
+
+ // content::WebContentsObserver implementation.
+ // Cancels the print job.
+ void NavigationStopped() override;
+
+ // Terminates or cancels the print job if one was pending.
+ void RenderProcessGone(base::TerminationStatus status) override;
+
+ // content::WebContentsObserver implementation.
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ // IPC handlers
+ void OnDidShowPrintDialog();
+ void OnRequestPrintPreview(const PrintHostMsg_RequestPrintPreview_Params&);
+ void OnMetafileReadyForPrinting(const PrintHostMsg_DidPreviewDocument_Params& params);
+
+#if defined(ENABLE_BASIC_PRINTING)
+ bool PrintToPDFInternal(const QPageLayout &);
+#endif //
+
+ base::FilePath m_pdfOutputPath;
+ PrintToPDFCallback m_pdfPrintCallback;
+
+private:
+ friend class content::WebContentsUserData<PrintViewManagerQt>;
+
+ void resetPdfState();
+
+ // content::WebContentsObserver implementation.
+ void DidStartLoading() override;
+ DISALLOW_COPY_AND_ASSIGN(PrintViewManagerQt);
+};
+
+} // namespace QtWebEngineCore
+#endif // PRINT_VIEW_MANAGER_QT_H
+
diff --git a/src/core/printing_message_filter_qt.cpp b/src/core/printing_message_filter_qt.cpp
new file mode 100644
index 000000000..ba4d5c6e6
--- /dev/null
+++ b/src/core/printing_message_filter_qt.cpp
@@ -0,0 +1,261 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on chrome/browser/printing/printing_message_filter.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "printing_message_filter_qt.h"
+
+#include "web_engine_context.h"
+
+#include <string>
+
+#include "base/bind.h"
+#include "chrome/browser/printing/print_job_manager.h"
+#include "chrome/browser/printing/printer_query.h"
+#include "components/printing/browser/print_manager_utils.h"
+#include "components/printing/common/print_messages.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/common/child_process_host.h"
+
+using content::BrowserThread;
+
+namespace QtWebEngineCore {
+
+PrintingMessageFilterQt::PrintingMessageFilterQt(int render_process_id)
+ : BrowserMessageFilter(PrintMsgStart),
+ render_process_id_(render_process_id),
+ queue_(WebEngineContext::current()->getPrintJobManager()->queue()) {
+ DCHECK(queue_.get());
+}
+
+PrintingMessageFilterQt::~PrintingMessageFilterQt() {
+}
+
+void PrintingMessageFilterQt::OverrideThreadForMessage(
+ const IPC::Message& message, BrowserThread::ID* thread) {
+}
+
+bool PrintingMessageFilterQt::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(PrintingMessageFilterQt, message)
+#if defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DuplicateSection, OnDuplicateSection)
+#endif
+ IPC_MESSAGE_HANDLER(PrintHostMsg_IsPrintingEnabled, OnIsPrintingEnabled)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_GetDefaultPrintSettings,
+ OnGetDefaultPrintSettings)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_ScriptedPrint, OnScriptedPrint)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_UpdatePrintSettings,
+ OnUpdatePrintSettings)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_CheckForCancel, OnCheckForCancel)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+#if defined(OS_WIN)
+void PrintingMessageFilterQt::OnDuplicateSection(
+ base::SharedMemoryHandle renderer_handle,
+ base::SharedMemoryHandle* browser_handle) {
+ // Duplicate the handle in this process right now so the memory is kept alive
+ // (even if it is not mapped)
+ base::SharedMemory shared_buf(renderer_handle, true, PeerHandle());
+ shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), browser_handle);
+}
+#endif
+
+void PrintingMessageFilterQt::OnIsPrintingEnabled(bool* is_enabled) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ *is_enabled = true;
+}
+
+void PrintingMessageFilterQt::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ scoped_refptr<printing::PrinterQuery> printer_query;
+
+ printer_query = queue_->PopPrinterQuery(0);
+ if (!printer_query.get()) {
+ printer_query =
+ queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
+ }
+
+ // Loads default settings. This is asynchronous, only the IPC message sender
+ // will hang until the settings are retrieved.
+ printer_query->GetSettings(
+ printing::PrinterQuery::GetSettingsAskParam::DEFAULTS,
+ 0,
+ false,
+ printing::DEFAULT_MARGINS,
+ false,
+ base::Bind(&PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply,
+ this,
+ printer_query,
+ reply_msg));
+}
+
+void PrintingMessageFilterQt::OnGetDefaultPrintSettingsReply(
+ scoped_refptr<printing::PrinterQuery> printer_query,
+ IPC::Message* reply_msg) {
+ PrintMsg_Print_Params params;
+ if (!printer_query.get() ||
+ printer_query->last_status() != printing::PrintingContext::OK) {
+ params.Reset();
+ } else {
+ RenderParamsFromPrintSettings(printer_query->settings(), &params);
+ params.document_cookie = printer_query->cookie();
+ }
+ PrintHostMsg_GetDefaultPrintSettings::WriteReplyParams(reply_msg, params);
+ Send(reply_msg);
+ // If printing was enabled.
+ if (printer_query.get()) {
+ // If user hasn't cancelled.
+ if (printer_query->cookie() && printer_query->settings().dpi()) {
+ queue_->QueuePrinterQuery(printer_query.get());
+ } else {
+ printer_query->StopWorker();
+ }
+ }
+}
+
+void PrintingMessageFilterQt::OnScriptedPrint(
+ const PrintHostMsg_ScriptedPrint_Params& params,
+ IPC::Message* reply_msg) {
+ scoped_refptr<printing::PrinterQuery> printer_query =
+ queue_->PopPrinterQuery(params.cookie);
+ if (!printer_query.get()) {
+ printer_query =
+ queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
+ }
+ printer_query->GetSettings(
+ printing::PrinterQuery::GetSettingsAskParam::ASK_USER,
+ params.expected_pages_count,
+ params.has_selection,
+ params.margin_type,
+ params.is_scripted,
+ base::Bind(&PrintingMessageFilterQt::OnScriptedPrintReply,
+ this,
+ printer_query,
+ reply_msg));
+}
+
+void PrintingMessageFilterQt::OnScriptedPrintReply(
+ scoped_refptr<printing::PrinterQuery> printer_query,
+ IPC::Message* reply_msg) {
+ PrintMsg_PrintPages_Params params;
+
+ if (printer_query->last_status() != printing::PrintingContext::OK ||
+ !printer_query->settings().dpi()) {
+ params.Reset();
+ } else {
+ RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
+ params.params.document_cookie = printer_query->cookie();
+ params.pages = printing::PageRange::GetPages(printer_query->settings().ranges());
+ }
+ PrintHostMsg_ScriptedPrint::WriteReplyParams(reply_msg, params);
+ Send(reply_msg);
+ if (params.params.dpi && params.params.document_cookie) {
+ queue_->QueuePrinterQuery(printer_query.get());
+ } else {
+ printer_query->StopWorker();
+ }
+}
+
+void PrintingMessageFilterQt::OnUpdatePrintSettings(
+ int document_cookie, const base::DictionaryValue& job_settings,
+ IPC::Message* reply_msg) {
+ scoped_ptr<base::DictionaryValue> new_settings(job_settings.DeepCopy());
+
+ scoped_refptr<printing::PrinterQuery> printer_query;
+ printer_query = queue_->PopPrinterQuery(document_cookie);
+ if (!printer_query.get()) {
+ int host_id = render_process_id_;
+ int routing_id = reply_msg->routing_id();
+ if (!new_settings->GetInteger(printing::kPreviewInitiatorHostId,
+ &host_id) ||
+ !new_settings->GetInteger(printing::kPreviewInitiatorRoutingId,
+ &routing_id)) {
+ host_id = content::ChildProcessHost::kInvalidUniqueID;
+ routing_id = content::ChildProcessHost::kInvalidUniqueID;
+ }
+ printer_query = queue_->CreatePrinterQuery(host_id, routing_id);
+ }
+ printer_query->SetSettings(
+ std::move(new_settings),
+ base::Bind(&PrintingMessageFilterQt::OnUpdatePrintSettingsReply, this,
+ printer_query, reply_msg));
+}
+
+void PrintingMessageFilterQt::OnUpdatePrintSettingsReply(
+ scoped_refptr<printing::PrinterQuery> printer_query,
+ IPC::Message* reply_msg) {
+ PrintMsg_PrintPages_Params params;
+ if (!printer_query.get() ||
+ printer_query->last_status() != printing::PrintingContext::OK) {
+ params.Reset();
+ } else {
+ RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
+ params.params.document_cookie = printer_query->cookie();
+ params.pages = printing::PageRange::GetPages(printer_query->settings().ranges());
+ }
+
+ PrintHostMsg_UpdatePrintSettings::WriteReplyParams(
+ reply_msg,
+ params,
+ printer_query.get() &&
+ (printer_query->last_status() == printing::PrintingContext::CANCEL));
+ Send(reply_msg);
+ // If user hasn't cancelled.
+ if (printer_query.get()) {
+ if (printer_query->cookie() && printer_query->settings().dpi()) {
+ queue_->QueuePrinterQuery(printer_query.get());
+ } else {
+ printer_query->StopWorker();
+ }
+ }
+}
+
+void PrintingMessageFilterQt::OnCheckForCancel(int32_t preview_ui_id,
+ int preview_request_id,
+ bool* cancel) {
+ *cancel = false;
+}
+
+} // namespace printing
diff --git a/src/core/printing_message_filter_qt.h b/src/core/printing_message_filter_qt.h
new file mode 100644
index 000000000..95d63f570
--- /dev/null
+++ b/src/core/printing_message_filter_qt.h
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PRINTING_PRINTING_MESSAGE_FILTER_QT_H_
+#define PRINTING_PRINTING_MESSAGE_FILTER_QT_H_
+
+#include <string>
+
+#include "base/compiler_specific.h"
+#include "base/prefs/pref_member.h"
+#include "content/public/browser/browser_message_filter.h"
+
+#if defined(OS_WIN)
+#include "base/memory/shared_memory.h"
+#endif
+
+struct PrintHostMsg_ScriptedPrint_Params;
+
+namespace base {
+class DictionaryValue;
+class FilePath;
+}
+
+namespace content {
+class WebContents;
+}
+
+namespace printing {
+
+class PrintJobManager;
+class PrintQueriesQueue;
+class PrinterQuery;
+}
+
+namespace QtWebEngineCore {
+// This class filters out incoming printing related IPC messages for the
+// renderer process on the IPC thread.
+class PrintingMessageFilterQt : public content::BrowserMessageFilter {
+ public:
+ PrintingMessageFilterQt(int render_process_id);
+
+ // content::BrowserMessageFilter methods.
+ void OverrideThreadForMessage(const IPC::Message& message,
+ content::BrowserThread::ID* thread) override;
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+ ~PrintingMessageFilterQt() override;
+
+#if defined(OS_WIN)
+ // Used to pass resulting EMF from renderer to browser in printing.
+ void OnDuplicateSection(base::SharedMemoryHandle renderer_handle,
+ base::SharedMemoryHandle* browser_handle);
+#endif
+
+ // GetPrintSettingsForRenderView must be called via PostTask and
+ // base::Bind. Collapse the settings-specific params into a
+ // struct to avoid running into issues with too many params
+ // to base::Bind.
+ struct GetPrintSettingsForRenderViewParams;
+
+ // Checks if printing is enabled.
+ void OnIsPrintingEnabled(bool* is_enabled);
+
+ // Get the default print setting.
+ void OnGetDefaultPrintSettings(IPC::Message* reply_msg);
+ void OnGetDefaultPrintSettingsReply(scoped_refptr<printing::PrinterQuery> printer_query,
+ IPC::Message* reply_msg);
+
+ // The renderer host have to show to the user the print dialog and returns
+ // the selected print settings. The task is handled by the print worker
+ // thread and the UI thread. The reply occurs on the IO thread.
+ void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params,
+ IPC::Message* reply_msg);
+ void OnScriptedPrintReply(scoped_refptr<printing::PrinterQuery> printer_query,
+ IPC::Message* reply_msg);
+
+ // Modify the current print settings based on |job_settings|. The task is
+ // handled by the print worker thread and the UI thread. The reply occurs on
+ // the IO thread.
+ void OnUpdatePrintSettings(int document_cookie,
+ const base::DictionaryValue& job_settings,
+ IPC::Message* reply_msg);
+ void OnUpdatePrintSettingsReply(scoped_refptr<printing::PrinterQuery> printer_query,
+ IPC::Message* reply_msg);
+
+ // Check to see if print preview has been cancelled.
+ void OnCheckForCancel(int32_t preview_ui_id,
+ int preview_request_id,
+ bool* cancel);
+
+ const int render_process_id_;
+
+ scoped_refptr<printing::PrintQueriesQueue> queue_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrintingMessageFilterQt);
+};
+
+} // namespace printing
+
+#endif // PRINTING_PRINTING_MESSAGE_FILTER_QT_H_
diff --git a/src/core/process_main.cpp b/src/core/process_main.cpp
index 1a67417fb..3a3e28707 100644
--- a/src/core/process_main.cpp
+++ b/src/core/process_main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,7 +43,7 @@
#include "content/public/app/content_main.h"
#if defined(OS_WIN)
#include "sandbox/win/src/sandbox_types.h"
-#include "content/public/app/startup_helper_win.h"
+#include "content/public/app/sandbox_helper_win.h"
#endif // OS_WIN
namespace QtWebEngine {
diff --git a/src/core/process_main.h b/src/core/process_main.h
index 507d4a844..890bf5a85 100644
--- a/src/core/process_main.h
+++ b/src/core/process_main.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/proxy_config_service_qt.cpp b/src/core/proxy_config_service_qt.cpp
index d966e275d..bd5d0375d 100644
--- a/src/core/proxy_config_service_qt.cpp
+++ b/src/core/proxy_config_service_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -66,8 +69,8 @@ net::ProxyServer ProxyConfigServiceQt::fromQNetworkProxy(const QNetworkProxy &qt
//================ Based on ChromeProxyConfigService =======================
-ProxyConfigServiceQt::ProxyConfigServiceQt(net::ProxyConfigService *baseService)
- : m_baseService(baseService),
+ProxyConfigServiceQt::ProxyConfigServiceQt(scoped_ptr<ProxyConfigService> baseService)
+ : m_baseService(baseService.release()),
m_registeredObserver(false)
{
}
diff --git a/src/core/proxy_config_service_qt.h b/src/core/proxy_config_service_qt.h
index ee4263314..da24e3337 100644
--- a/src/core/proxy_config_service_qt.h
+++ b/src/core/proxy_config_service_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,7 +40,6 @@
#ifndef PROXY_CONFIG_SERVICE_QT_H
#define PROXY_CONFIG_SERVICE_QT_H
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
@@ -54,7 +56,7 @@ public:
static net::ProxyServer fromQNetworkProxy(const QNetworkProxy &);
- explicit ProxyConfigServiceQt(net::ProxyConfigService *baseService);
+ explicit ProxyConfigServiceQt(scoped_ptr<ProxyConfigService> baseService);
~ProxyConfigServiceQt() override;
// ProxyConfigService implementation:
diff --git a/src/core/qrc_protocol_handler_qt.cpp b/src/core/qrc_protocol_handler_qt.cpp
index d1c1ee4b2..222961762 100644
--- a/src/core/qrc_protocol_handler_qt.cpp
+++ b/src/core/qrc_protocol_handler_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/qrc_protocol_handler_qt.h b/src/core/qrc_protocol_handler_qt.h
index ff44bd970..53d063810 100644
--- a/src/core/qrc_protocol_handler_qt.h
+++ b/src/core/qrc_protocol_handler_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/qtwebengine.gypi b/src/core/qtwebengine.gypi
index 585f22324..816962d3d 100644
--- a/src/core/qtwebengine.gypi
+++ b/src/core/qtwebengine.gypi
@@ -8,6 +8,7 @@
'dependencies': [
'<(chromium_src_dir)/base/base.gyp:base',
'<(chromium_src_dir)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ '<(chromium_src_dir)/chrome/tools/convert_dict/convert_dict.gyp:convert_dict_lib',
'<(chromium_src_dir)/components/components.gyp:devtools_discovery',
'<(chromium_src_dir)/components/components.gyp:devtools_http_handler',
'<(chromium_src_dir)/components/components.gyp:error_page_renderer',
@@ -15,6 +16,7 @@
'<(chromium_src_dir)/components/components.gyp:visitedlink_renderer',
'<(chromium_src_dir)/components/components.gyp:web_cache_browser',
'<(chromium_src_dir)/components/components.gyp:web_cache_renderer',
+ '<(chromium_src_dir)/components/components.gyp:cdm_renderer',
'<(chromium_src_dir)/content/content.gyp:content',
'<(chromium_src_dir)/content/content.gyp:content_app_browser',
'<(chromium_src_dir)/content/content.gyp:content_browser',
@@ -67,10 +69,6 @@
['qt_os=="embedded_linux"', {
'configurations': {
'Debug_Base': {
- # Reduce the binary size.
- 'variables': {
- 'debug_optimize%': 's',
- },
'ldflags': [
# Only link with needed input sections.
'-Wl,--gc-sections',
@@ -119,6 +117,23 @@
['OS=="mac"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
}],
+ ['enable_basic_printing==1 or enable_print_preview==1', {
+ 'dependencies': [
+ '<(chromium_src_dir)/components/components.gyp:printing_browser',
+ '<(chromium_src_dir)/components/components.gyp:printing_common',
+ '<(chromium_src_dir)/components/components.gyp:printing_renderer',
+ ],
+ 'sources': [
+ 'printing_message_filter_qt.cpp',
+ 'print_view_manager_base_qt.cpp',
+ 'print_view_manager_qt.cpp',
+ 'printing_message_filter_qt.h',
+ 'print_view_manager_base_qt.h',
+ 'print_view_manager_qt.h',
+ 'renderer/print_web_view_helper_delegate_qt.cpp',
+ 'renderer/print_web_view_helper_delegate_qt.h',
+ ]
+ }],
['icu_use_data_file_flag==1', {
'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
}, { # else icu_use_data_file_flag !=1
diff --git a/src/core/qtwebengine_extras.gypi b/src/core/qtwebengine_extras.gypi
index a5de08b55..229421efa 100644
--- a/src/core/qtwebengine_extras.gypi
+++ b/src/core/qtwebengine_extras.gypi
@@ -63,6 +63,28 @@
'defines': [
'TOOLKIT_QT',
],
+ 'configurations': {
+ 'Debug': {
+ 'defines': [
+ 'QTWEBENGINEPROCESS_NAME="<(qtwe_process_name_debug)"'
+ ],
+ },
+ 'Debug_x64': {
+ 'defines': [
+ 'QTWEBENGINEPROCESS_NAME="<(qtwe_process_name_debug)"'
+ ],
+ },
+ 'Release': {
+ 'defines': [
+ 'QTWEBENGINEPROCESS_NAME="<(qtwe_process_name_release)"'
+ ],
+ },
+ 'Release_x64': {
+ 'defines': [
+ 'QTWEBENGINEPROCESS_NAME="<(qtwe_process_name_release)"'
+ ],
+ },
+ },
},
'conditions': [
[ 'qt_os=="embedded_linux"', {
diff --git a/src/core/render_view_observer_host_qt.cpp b/src/core/render_view_observer_host_qt.cpp
index 03c9d241f..c03cecb38 100644
--- a/src/core/render_view_observer_host_qt.cpp
+++ b/src/core/render_view_observer_host_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/render_view_observer_host_qt.h b/src/core/render_view_observer_host_qt.h
index 2683e5807..f352be7b9 100644
--- a/src/core/render_view_observer_host_qt.h
+++ b/src/core/render_view_observer_host_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index deb273f49..f45db6bf4 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -93,7 +96,7 @@ static inline ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& even
ui::LatencyInfo latency_info;
// The latency number should only be added if the timestamp is valid.
if (event.timeStampSeconds) {
- const int64 time_micros = static_cast<int64>(
+ const int64_t time_micros = static_cast<int64_t>(
event.timeStampSeconds * base::Time::kMicrosecondsPerSecond);
latency_info.AddLatencyNumberWithTimestamp(
ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
@@ -164,31 +167,7 @@ static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const
return lhs.state() < rhs.state();
}
-static inline int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
-{
- int modifierFlags = ui::EF_NONE;
-#if defined(Q_OS_OSX)
- if (!qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
- if ((modifiers & Qt::ControlModifier) != 0)
- modifierFlags |= ui::EF_COMMAND_DOWN;
- if ((modifiers & Qt::MetaModifier) != 0)
- modifierFlags |= ui::EF_CONTROL_DOWN;
- } else
-#endif
- {
- if ((modifiers & Qt::ControlModifier) != 0)
- modifierFlags |= ui::EF_CONTROL_DOWN;
- if ((modifiers & Qt::MetaModifier) != 0)
- modifierFlags |= ui::EF_COMMAND_DOWN;
- }
- if ((modifiers & Qt::ShiftModifier) != 0)
- modifierFlags |= ui::EF_SHIFT_DOWN;
- if ((modifiers & Qt::AltModifier) != 0)
- modifierFlags |= ui::EF_ALT_DOWN;
- return modifierFlags;
-}
-
-static uint32 s_eventId = 0;
+static uint32_t s_eventId = 0;
class MotionEventQt : public ui::MotionEvent {
public:
MotionEventQt(const QList<QTouchEvent::TouchPoint> &touchPoints, const base::TimeTicks &eventTime, Action action, const Qt::KeyboardModifiers modifiers, float dpiScale, int index = -1)
@@ -204,7 +183,7 @@ public:
Q_ASSERT((action != ACTION_DOWN && action != ACTION_UP) || index == 0);
}
- virtual uint32 GetUniqueEventId() const Q_DECL_OVERRIDE { return eventId; }
+ virtual uint32_t GetUniqueEventId() const Q_DECL_OVERRIDE { return eventId; }
virtual Action GetAction() const Q_DECL_OVERRIDE { return action; }
virtual int GetActionIndex() const Q_DECL_OVERRIDE { return index; }
virtual size_t GetPointerCount() const Q_DECL_OVERRIDE { return touchPoints.size(); }
@@ -229,6 +208,7 @@ public:
}
virtual int GetFlags() const Q_DECL_OVERRIDE { return flags; }
virtual float GetPressure(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).pressure(); }
+ virtual float GetTilt(size_t pointer_index) const Q_DECL_OVERRIDE { return 0; }
virtual base::TimeTicks GetEventTime() const Q_DECL_OVERRIDE { return eventTime; }
virtual size_t GetHistorySize() const Q_DECL_OVERRIDE { return 0; }
@@ -243,7 +223,7 @@ private:
QList<QTouchEvent::TouchPoint> touchPoints;
base::TimeTicks eventTime;
Action action;
- const uint32 eventId;
+ const uint32_t eventId;
int flags;
int index;
float dpiScale;
@@ -388,7 +368,6 @@ content::BrowserAccessibilityManager* RenderWidgetHostViewQt::CreateBrowserAcces
// Set focus to the associated View component.
void RenderWidgetHostViewQt::Focus()
{
- m_host->SetInputMethodActive(true);
if (!IsPopup())
m_delegate->setKeyboardFocus();
m_host->Focus();
@@ -601,13 +580,10 @@ void RenderWidgetHostViewQt::SetIsLoading(bool)
// We use WebContentsDelegateQt::LoadingStateChanged to notify about loading state.
}
-void RenderWidgetHostViewQt::TextInputTypeChanged(ui::TextInputType type, ui::TextInputMode mode, bool can_compose_inline, int flags)
+void RenderWidgetHostViewQt::TextInputStateChanged(const ViewHostMsg_TextInputState_Params &params)
{
- Q_UNUSED(mode);
- Q_UNUSED(can_compose_inline);
- Q_UNUSED(flags);
- m_currentInputType = type;
- m_delegate->inputMethodStateChanged(static_cast<bool>(type));
+ m_currentInputType = params.type;
+ m_delegate->inputMethodStateChanged(params.type != ui::TEXT_INPUT_TYPE_NONE);
}
void RenderWidgetHostViewQt::ImeCancelComposition()
@@ -655,7 +631,7 @@ void RenderWidgetHostViewQt::SelectionBoundsChanged(const ViewHostMsg_SelectionB
m_cursorRect = QRect(caretRect.x(), caretRect.y(), caretRect.width(), caretRect.height());
}
-void RenderWidgetHostViewQt::CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& dst_size, content::ReadbackRequestCallback& callback, const SkColorType color_type)
+void RenderWidgetHostViewQt::CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& dst_size, const content::ReadbackRequestCallback& callback, const SkColorType color_type)
{
NOTIMPLEMENTED();
Q_UNUSED(src_subrect);
@@ -664,10 +640,10 @@ void RenderWidgetHostViewQt::CopyFromCompositingSurface(const gfx::Rect& src_sub
callback.Run(SkBitmap(), content::READBACK_FAILED);
}
-void RenderWidgetHostViewQt::CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback)
+void RenderWidgetHostViewQt::CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(const gfx::Rect&, bool)>& callback)
{
NOTIMPLEMENTED();
- callback.Run(false);
+ callback.Run(gfx::Rect(), false);
}
bool RenderWidgetHostViewQt::CanCopyToVideoFrame() const
@@ -680,15 +656,26 @@ bool RenderWidgetHostViewQt::HasAcceleratedSurface(const gfx::Size&)
return false;
}
-void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame)
+void RenderWidgetHostViewQt::LockCompositingSurface()
+{
+}
+
+void RenderWidgetHostViewQt::UnlockCompositingSurface()
{
+}
+
+void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32_t output_surface_id, scoped_ptr<cc::CompositorFrame> frame)
+{
+ bool scrollOffsetChanged = (m_lastScrollOffset != frame->metadata.root_scroll_offset);
+ bool contentsSizeChanged = (m_lastContentsSize != frame->metadata.root_layer_size);
m_lastScrollOffset = frame->metadata.root_scroll_offset;
+ m_lastContentsSize = frame->metadata.root_layer_size;
Q_ASSERT(!m_needsDelegatedFrameAck);
m_needsDelegatedFrameAck = true;
m_pendingOutputSurfaceId = output_surface_id;
Q_ASSERT(frame->delegated_frame_data);
Q_ASSERT(!m_chromiumCompositorData->frameData || m_chromiumCompositorData->frameData->resource_list.empty());
- m_chromiumCompositorData->frameData = frame->delegated_frame_data.Pass();
+ m_chromiumCompositorData->frameData = std::move(frame->delegated_frame_data);
m_chromiumCompositorData->frameDevicePixelRatio = frame->metadata.device_scale_factor;
// Support experimental.viewport.devicePixelRatio, see GetScreenInfo implementation below.
@@ -702,6 +689,11 @@ void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32 output_surface_id, sco
m_adapterClient->loadVisuallyCommitted();
m_didFirstVisuallyNonEmptyLayout = false;
}
+
+ if (scrollOffsetChanged)
+ m_adapterClient->updateScrollPosition(toQt(m_lastScrollOffset));
+ if (contentsSizeChanged)
+ m_adapterClient->updateContentsSize(toQt(m_lastContentsSize));
}
void RenderWidgetHostViewQt::GetScreenInfo(blink::WebScreenInfo* results)
@@ -724,9 +716,13 @@ gfx::Rect RenderWidgetHostViewQt::GetBoundsInRootWindow()
return gfx::Rect(r.x(), r.y(), r.width(), r.height());
}
-gfx::GLSurfaceHandle RenderWidgetHostViewQt::GetCompositingSurface()
+void RenderWidgetHostViewQt::ClearCompositorFrame()
{
- return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT);
+}
+
+bool RenderWidgetHostViewQt::GetScreenColorProfile(std::vector<char>*)
+{
+ return false;
}
void RenderWidgetHostViewQt::SelectionChanged(const base::string16 &text, size_t offset, const gfx::Range &range)
@@ -1228,11 +1224,12 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev)
if (ev->gotFocus()) {
m_host->GotFocus();
m_host->SetActive(true);
- Q_ASSERT(m_host->IsRenderView());
+ content::RenderViewHostImpl *viewHost = content::RenderViewHostImpl::From(m_host);
+ Q_ASSERT(viewHost);
if (ev->reason() == Qt::TabFocusReason)
- static_cast<content::RenderViewHostImpl*>(m_host)->SetInitialFocus(false);
+ viewHost->SetInitialFocus(false);
else if (ev->reason() == Qt::BacktabFocusReason)
- static_cast<content::RenderViewHostImpl*>(m_host)->SetInitialFocus(true);
+ viewHost->SetInitialFocus(true);
ev->accept();
} else if (ev->lostFocus()) {
m_host->SetActive(false);
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 5a0ea6f03..523d1c49d 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -132,22 +135,26 @@ public:
virtual void MovePluginWindows(const std::vector<content::WebPluginGeometry>&) Q_DECL_OVERRIDE;
virtual void UpdateCursor(const content::WebCursor&) Q_DECL_OVERRIDE;
virtual void SetIsLoading(bool) Q_DECL_OVERRIDE;
- virtual void TextInputTypeChanged(ui::TextInputType type, ui::TextInputMode mode, bool can_compose_inline, int flags) Q_DECL_OVERRIDE;
+ virtual void TextInputStateChanged(const ViewHostMsg_TextInputState_Params&) Q_DECL_OVERRIDE;
virtual void ImeCancelComposition() Q_DECL_OVERRIDE;
virtual void ImeCompositionRangeChanged(const gfx::Range&, const std::vector<gfx::Rect>&) Q_DECL_OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus, int) Q_DECL_OVERRIDE;
virtual void Destroy() Q_DECL_OVERRIDE;
virtual void SetTooltipText(const base::string16 &tooltip_text) Q_DECL_OVERRIDE;
virtual void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params&) Q_DECL_OVERRIDE;
- virtual void CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& dst_size, content::ReadbackRequestCallback& callback, const SkColorType color_type) Q_DECL_OVERRIDE;
- virtual void CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) Q_DECL_OVERRIDE;
+ virtual void CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& dst_size, const content::ReadbackRequestCallback& callback, const SkColorType preferred_color_type) Q_DECL_OVERRIDE;
+ virtual void CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(const gfx::Rect&, bool)>& callback) Q_DECL_OVERRIDE;
+
virtual bool CanCopyToVideoFrame() const Q_DECL_OVERRIDE;
virtual bool HasAcceleratedSurface(const gfx::Size&) Q_DECL_OVERRIDE;
- virtual void OnSwapCompositorFrame(uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) Q_DECL_OVERRIDE;
+ virtual void OnSwapCompositorFrame(uint32_t output_surface_id, scoped_ptr<cc::CompositorFrame> frame) Q_DECL_OVERRIDE;
virtual void GetScreenInfo(blink::WebScreenInfo* results) Q_DECL_OVERRIDE;
virtual gfx::Rect GetBoundsInRootWindow() Q_DECL_OVERRIDE;
- virtual gfx::GLSurfaceHandle GetCompositingSurface() Q_DECL_OVERRIDE;
virtual void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) Q_DECL_OVERRIDE;
+ virtual void ClearCompositorFrame() Q_DECL_OVERRIDE;
+ virtual bool GetScreenColorProfile(std::vector<char>*) Q_DECL_OVERRIDE;
+ virtual void LockCompositingSurface() Q_DECL_OVERRIDE;
+ virtual void UnlockCompositingSurface() Q_DECL_OVERRIDE;
// Overridden from RenderWidgetHostViewBase.
virtual void SelectionChanged(const base::string16 &text, size_t offset, const gfx::Range &range) Q_DECL_OVERRIDE;
@@ -202,6 +209,8 @@ public:
#endif // QT_NO_ACCESSIBILITY
void didFirstVisuallyNonEmptyLayout();
+ gfx::SizeF lastContentsSize() const { return m_lastContentsSize; }
+
private:
void sendDelegatedFrameAck();
void processMotionEvent(const ui::MotionEvent &motionEvent);
@@ -224,7 +233,7 @@ private:
cc::ReturnedResourceArray m_resourcesToRelease;
bool m_needsDelegatedFrameAck;
bool m_didFirstVisuallyNonEmptyLayout;
- uint32 m_pendingOutputSurfaceId;
+ uint32_t m_pendingOutputSurfaceId;
QMetaObject::Connection m_adapterClientDestroyedConnection;
WebContentsAdapterClient *m_adapterClient;
@@ -241,6 +250,7 @@ private:
bool m_initPending;
gfx::Vector2dF m_lastScrollOffset;
+ gfx::SizeF m_lastContentsSize;
};
} // namespace QtWebEngineCore
diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h
index f4aa9b27d..ce6ec730a 100644
--- a/src/core/render_widget_host_view_qt_delegate.h
+++ b/src/core/render_widget_host_view_qt_delegate.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 3886e54a0..5d1780cbe 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -36,9 +39,20 @@
#include "renderer/content_renderer_client_qt.h"
+#include "common/qt_messages.h"
+
+#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/localized_error.h"
+#if defined(ENABLE_SPELLCHECK)
+#include "chrome/renderer/spellchecker/spellcheck.h"
+#include "chrome/renderer/spellchecker/spellcheck_provider.h"
+#endif
+#include "components/cdm/renderer/widevine_key_systems.h"
#include "components/error_page/common/error_page_params.h"
+#if defined (ENABLE_BASIC_PRINTING)
+#include "components/printing/renderer/print_web_view_helper.h"
+#endif // if defined(ENABLE_BASIC_PRINTING)
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "components/web_cache/renderer/web_cache_render_process_observer.h"
#include "content/public/renderer/render_frame.h"
@@ -54,12 +68,18 @@
#include "content/public/common/web_preferences.h"
#include "renderer/web_channel_ipc_transport.h"
+#if defined (ENABLE_BASIC_PRINTING)
+#include "renderer/print_web_view_helper_delegate_qt.h"
+#endif // if defined(ENABLE_BASIC_PRINTING)
+
#include "renderer/render_frame_observer_qt.h"
#include "renderer/render_view_observer_qt.h"
-#include "renderer/user_script_controller.h"
+#include "renderer/user_resource_controller.h"
#include "grit/renderer_resources.h"
+#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
+
namespace QtWebEngineCore {
static const char kHttpErrorDomain[] = "http";
@@ -87,14 +107,18 @@ ContentRendererClientQt::~ContentRendererClientQt()
void ContentRendererClientQt::RenderThreadStarted()
{
content::RenderThread *renderThread = content::RenderThread::Get();
- renderThread->RegisterExtension(WebChannelIPCTransport::getV8Extension());
m_visitedLinkSlave.reset(new visitedlink::VisitedLinkSlave);
m_webCacheObserver.reset(new web_cache::WebCacheRenderProcessObserver());
m_renderProcessObserver.reset(new RenderProcessObserverQt());
renderThread->AddObserver(m_visitedLinkSlave.data());
renderThread->AddObserver(m_webCacheObserver.data());
- renderThread->AddObserver(UserScriptController::instance());
+ renderThread->AddObserver(UserResourceController::instance());
renderThread->AddObserver(m_renderProcessObserver.data());
+
+#if defined(ENABLE_SPELLCHECK)
+ m_spellCheck.reset(new SpellCheck());
+ renderThread->AddObserver(m_spellCheck.data());
+#endif
}
void ContentRendererClientQt::RenderViewCreated(content::RenderView* render_view)
@@ -102,7 +126,17 @@ void ContentRendererClientQt::RenderViewCreated(content::RenderView* render_view
// RenderViewObservers destroy themselves with their RenderView.
new RenderViewObserverQt(render_view, m_webCacheObserver.data());
new WebChannelIPCTransport(render_view);
- UserScriptController::instance()->renderViewCreated(render_view);
+ UserResourceController::instance()->renderViewCreated(render_view);
+#if defined(ENABLE_SPELLCHECK)
+ new SpellCheckProvider(render_view, m_spellCheck.data());
+#endif
+
+#if defined(ENABLE_BASIC_PRINTING)
+ new printing::PrintWebViewHelper(
+ render_view,
+ scoped_ptr<printing::PrintWebViewHelper::Delegate>(
+ new PrintWebViewHelperDelegateQt()));
+#endif // defined(ENABLE_BASIC_PRINTING)
}
void ContentRendererClientQt::RenderFrameCreated(content::RenderFrame* render_frame)
@@ -127,10 +161,9 @@ bool ContentRendererClientQt::ShouldSuppressErrorPage(content::RenderFrame *fram
}
// To tap into the chromium localized strings. Ripped from the chrome layer (highly simplified).
-void ContentRendererClientQt::GetNavigationErrorStrings(content::RenderView* renderView, blink::WebFrame *frame, const blink::WebURLRequest &failedRequest, const blink::WebURLError &error, std::string *errorHtml, base::string16 *errorDescription)
+void ContentRendererClientQt::GetNavigationErrorStrings(content::RenderFrame* renderFrame, const blink::WebURLRequest &failedRequest, const blink::WebURLError &error, std::string *errorHtml, base::string16 *errorDescription)
{
- Q_UNUSED(frame)
- const bool isPost = base::EqualsASCII(failedRequest.httpMethod(), "POST");
+ const bool isPost = QByteArray::fromStdString(failedRequest.httpMethod().utf8()) == QByteArrayLiteral("POST");
if (errorHtml) {
// Use a local error page.
@@ -141,8 +174,8 @@ void ContentRendererClientQt::GetNavigationErrorStrings(content::RenderView* ren
// TODO(elproxy): We could potentially get better diagnostics here by first calling
// NetErrorHelper::GetErrorStringsForDnsProbe, but that one is harder to untangle.
LocalizedError::GetStrings(error.reason, error.domain.utf8(), error.unreachableURL, isPost
- , error.staleCopyInCache && !isPost, locale, renderView->GetAcceptLanguages()
- , scoped_ptr<error_page::ErrorPageParams>(), &errorStrings);
+ , error.staleCopyInCache && !isPost, false, error_page::OfflinePageStatus::NONE, locale, renderFrame->GetRenderView()->GetAcceptLanguages()
+ , scoped_ptr<error_page::ErrorPageParams>(), &errorStrings);
resourceId = IDR_NET_ERROR_HTML;
@@ -154,7 +187,7 @@ void ContentRendererClientQt::GetNavigationErrorStrings(content::RenderView* ren
}
if (errorDescription)
- *errorDescription = LocalizedError::GetErrorDetails(error, isPost);
+ *errorDescription = LocalizedError::GetErrorDetails(error.domain.utf8(), error.reason, isPost);
}
unsigned long long ContentRendererClientQt::VisitedLinkHash(const char *canonicalUrl, size_t length)
@@ -167,4 +200,147 @@ bool ContentRendererClientQt::IsLinkVisited(unsigned long long linkHash)
return m_visitedLinkSlave->IsVisited(linkHash);
}
+// The following is based on chrome/renderer/media/chrome_key_systems.cc:
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#if defined(ENABLE_PEPPER_CDMS)
+static bool IsPepperCdmAvailable(const std::string& pepper_type,
+ std::vector<base::string16>* additional_param_names,
+ std::vector<base::string16>* additional_param_values)
+{
+ bool is_available = false;
+ content::RenderThread::Get()->Send(
+ new QtWebEngineHostMsg_IsInternalPluginAvailableForMimeType(
+ pepper_type,
+ &is_available,
+ additional_param_names,
+ additional_param_values));
+
+ return is_available;
+}
+
+// External Clear Key (used for testing).
+static void AddExternalClearKey(std::vector<media::KeySystemInfo>* concrete_key_systems)
+{
+ static const char kExternalClearKeyKeySystem[] =
+ "org.chromium.externalclearkey";
+ static const char kExternalClearKeyDecryptOnlyKeySystem[] =
+ "org.chromium.externalclearkey.decryptonly";
+ static const char kExternalClearKeyFileIOTestKeySystem[] =
+ "org.chromium.externalclearkey.fileiotest";
+ static const char kExternalClearKeyInitializeFailKeySystem[] =
+ "org.chromium.externalclearkey.initializefail";
+ static const char kExternalClearKeyCrashKeySystem[] =
+ "org.chromium.externalclearkey.crash";
+ static const char kExternalClearKeyPepperType[] =
+ "application/x-ppapi-clearkey-cdm";
+
+ std::vector<base::string16> additional_param_names;
+ std::vector<base::string16> additional_param_values;
+ if (!IsPepperCdmAvailable(kExternalClearKeyPepperType,
+ &additional_param_names,
+ &additional_param_values))
+ return;
+
+ media::KeySystemInfo info;
+ info.key_system = kExternalClearKeyKeySystem;
+
+ info.supported_init_data_types =
+ media::kInitDataTypeMaskWebM | media::kInitDataTypeMaskKeyIds;
+ info.supported_codecs = media::EME_CODEC_WEBM_ALL;
+#if defined(USE_PROPRIETARY_CODECS)
+ info.supported_init_data_types |= media::kInitDataTypeMaskCenc;
+ info.supported_codecs |= media::EME_CODEC_MP4_ALL;
+#endif // defined(USE_PROPRIETARY_CODECS)
+
+ info.max_audio_robustness = media::EmeRobustness::EMPTY;
+ info.max_video_robustness = media::EmeRobustness::EMPTY;
+
+ // Persistent sessions are faked.
+ info.persistent_license_support = media::EmeSessionTypeSupport::SUPPORTED;
+ info.persistent_release_message_support =
+ media::EmeSessionTypeSupport::NOT_SUPPORTED;
+ info.persistent_state_support = media::EmeFeatureSupport::REQUESTABLE;
+ info.distinctive_identifier_support = media::EmeFeatureSupport::NOT_SUPPORTED;
+
+ info.pepper_type = kExternalClearKeyPepperType;
+
+ concrete_key_systems->push_back(info);
+
+ // Add support of decrypt-only mode in ClearKeyCdm.
+ info.key_system = kExternalClearKeyDecryptOnlyKeySystem;
+ concrete_key_systems->push_back(info);
+
+ // A key system that triggers FileIO test in ClearKeyCdm.
+ info.key_system = kExternalClearKeyFileIOTestKeySystem;
+ concrete_key_systems->push_back(info);
+
+ // A key system that Chrome thinks is supported by ClearKeyCdm, but actually
+ // will be refused by ClearKeyCdm. This is to test the CDM initialization
+ // failure case.
+ info.key_system = kExternalClearKeyInitializeFailKeySystem;
+ concrete_key_systems->push_back(info);
+
+ // A key system that triggers a crash in ClearKeyCdm.
+ info.key_system = kExternalClearKeyCrashKeySystem;
+ concrete_key_systems->push_back(info);
+}
+
+#if defined(WIDEVINE_CDM_AVAILABLE)
+
+static void AddPepperBasedWidevine(std::vector<media::KeySystemInfo>* concrete_key_systems)
+{
+//#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
+// Version glibc_version(gnu_get_libc_version());
+// DCHECK(glibc_version.IsValid());
+// if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION))
+// return;
+//#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
+
+ std::vector<base::string16> additional_param_names;
+ std::vector<base::string16> additional_param_values;
+ if (!IsPepperCdmAvailable(kWidevineCdmPluginMimeType,
+ &additional_param_names,
+ &additional_param_values)) {
+ DVLOG(1) << "Widevine CDM is not currently available.";
+ return;
+ }
+
+ media::SupportedCodecs supported_codecs = media::EME_CODEC_NONE;
+
+ supported_codecs |= media::EME_CODEC_WEBM_OPUS;
+ supported_codecs |= media::EME_CODEC_WEBM_VORBIS;
+ supported_codecs |= media::EME_CODEC_WEBM_VP8;
+ supported_codecs |= media::EME_CODEC_WEBM_VP9;
+#if defined(USE_PROPRIETARY_CODECS)
+ supported_codecs |= media::EME_CODEC_MP4_AVC1;
+ supported_codecs |= media::EME_CODEC_MP4_AAC;
+#endif // defined(USE_PROPRIETARY_CODECS)
+
+ cdm::AddWidevineWithCodecs(
+ cdm::WIDEVINE, supported_codecs,
+ media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
+ media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness.
+ media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
+ media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message.
+ media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
+ media::EmeFeatureSupport::NOT_SUPPORTED, // Distinctive identifier.
+ concrete_key_systems);
+}
+#endif // defined(WIDEVINE_CDM_AVAILABLE)
+#endif // defined(ENABLE_PEPPER_CDMS)
+
+void ContentRendererClientQt::AddKeySystems(std::vector<media::KeySystemInfo>* key_systems_info)
+{
+#if defined(ENABLE_PEPPER_CDMS)
+ AddExternalClearKey(key_systems_info);
+
+#if defined(WIDEVINE_CDM_AVAILABLE)
+ AddPepperBasedWidevine(key_systems_info);
+#endif // defined(WIDEVINE_CDM_AVAILABLE)
+#endif // defined(ENABLE_PEPPER_CDMS)
+}
+
} // namespace
diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h
index 7df824e3e..d475c7801 100644
--- a/src/core/renderer/content_renderer_client_qt.h
+++ b/src/core/renderer/content_renderer_client_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -53,6 +56,10 @@ namespace web_cache {
class WebCacheRenderProcessObserver;
}
+#if defined(ENABLE_SPELLCHECK)
+class SpellCheck;
+#endif
+
namespace QtWebEngineCore {
class ContentRendererClientQt : public content::ContentRendererClient {
@@ -64,16 +71,20 @@ public:
virtual void RenderFrameCreated(content::RenderFrame* render_frame) Q_DECL_OVERRIDE;
virtual bool ShouldSuppressErrorPage(content::RenderFrame *, const GURL &) Q_DECL_OVERRIDE;
virtual bool HasErrorPage(int httpStatusCode, std::string *errorDomain) Q_DECL_OVERRIDE;
- virtual void GetNavigationErrorStrings(content::RenderView* renderView, blink::WebFrame* frame, const blink::WebURLRequest& failedRequest
+ virtual void GetNavigationErrorStrings(content::RenderFrame* renderFrame, const blink::WebURLRequest& failedRequest
, const blink::WebURLError& error, std::string* errorHtml, base::string16* errorDescription) Q_DECL_OVERRIDE;
virtual unsigned long long VisitedLinkHash(const char *canonicalUrl, size_t length) Q_DECL_OVERRIDE;
virtual bool IsLinkVisited(unsigned long long linkHash) Q_DECL_OVERRIDE;
+ virtual void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) Q_DECL_OVERRIDE;
private:
QScopedPointer<visitedlink::VisitedLinkSlave> m_visitedLinkSlave;
QScopedPointer<web_cache::WebCacheRenderProcessObserver> m_webCacheObserver;
QScopedPointer<content::RenderProcessObserver> m_renderProcessObserver;
+#if defined(ENABLE_SPELLCHECK)
+ QScopedPointer<SpellCheck> m_spellCheck;
+#endif
};
} // namespace
diff --git a/src/core/renderer/pepper/pepper_flash_browser_host_qt.cpp b/src/core/renderer/pepper/pepper_flash_browser_host_qt.cpp
index 625e89ae4..4427a67f2 100644
--- a/src/core/renderer/pepper/pepper_flash_browser_host_qt.cpp
+++ b/src/core/renderer/pepper/pepper_flash_browser_host_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,29 +11,33 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
+// This is based on chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -67,7 +71,6 @@ using content::RenderProcessHost;
namespace QtWebEngineCore {
-
PepperFlashBrowserHostQt::PepperFlashBrowserHostQt(BrowserPpapiHost* host,
PP_Instance instance,
PP_Resource resource)
diff --git a/src/core/renderer/pepper/pepper_flash_browser_host_qt.h b/src/core/renderer/pepper/pepper_flash_browser_host_qt.h
index c5165a1b0..5d1107dfb 100644
--- a/src/core/renderer/pepper/pepper_flash_browser_host_qt.h
+++ b/src/core/renderer/pepper/pepper_flash_browser_host_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,7 +40,6 @@
#ifndef PEPPER_FLASH_BROWSER_HOST_QT_H
#define PEPPER_FLASH_BROWSER_HOST_QT_H
-#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "ppapi/host/host_message_context.h"
diff --git a/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.cpp b/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.cpp
index 28472794d..c1782844d 100644
--- a/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.cpp
+++ b/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.cpp
@@ -268,8 +268,8 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgReadData(
base::string16 html;
std::string url;
- uint32 fragment_start;
- uint32 fragment_end;
+ uint32_t fragment_start;
+ uint32_t fragment_end;
clipboard->ReadHTML(type, &html, &url, &fragment_start, &fragment_end);
result = PP_OK;
clipboard_string = base::UTF16ToUTF8(html.substr(fragment_start, fragment_end - fragment_start));
diff --git a/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.h b/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.h
index a9e354dcf..c00e668ea 100644
--- a/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.h
+++ b/src/core/renderer/pepper/pepper_flash_clipboard_message_filter_qt.h
@@ -45,7 +45,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ppapi/host/resource_message_filter.h"
#include "ppapi/shared_impl/flash_clipboard_format_registry.h"
diff --git a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp b/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp
index 8e68d1682..37ce4b5f3 100644
--- a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp
+++ b/src/core/renderer/pepper/pepper_flash_renderer_host_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,29 +11,33 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
+// This is based on chrome/renderer/pepper/pepper_flash_renderer_host.cc:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -65,8 +69,8 @@
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPoint.h"
-#include "third_party/skia/include/core/SkTemplates.h"
#include "third_party/skia/include/core/SkTypeface.h"
+#include "third_party/skia/include/private/SkTemplates.h"
#include "ui/gfx/geometry/rect.h"
#include "url/gurl.h"
@@ -278,7 +282,7 @@ int32_t PepperFlashRendererHostQt::OnNavigate(
bool rejected = false;
while (header_iter.GetNext()) {
std::string lower_case_header_name =
- base::StringToLowerASCII(header_iter.name());
+ base::ToLowerASCII(header_iter.name());
if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
rejected = true;
diff --git a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h b/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h
index 4a731fad4..ae6bc0876 100644
--- a/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h
+++ b/src/core/renderer/pepper/pepper_flash_renderer_host_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,7 +43,6 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"
#include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h"
diff --git a/src/core/renderer/pepper/pepper_host_factory_qt.cpp b/src/core/renderer/pepper/pepper_host_factory_qt.cpp
index e43857fc9..9b7236d8a 100644
--- a/src/core/renderer/pepper/pepper_host_factory_qt.cpp
+++ b/src/core/renderer/pepper/pepper_host_factory_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,29 +11,37 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
+// This is based on chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
#include "pepper_host_factory_qt.h"
#include "build/build_config.h"
@@ -43,8 +51,10 @@
#include "ppapi/host/resource_host.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
+
#include "pepper_flash_browser_host_qt.h"
#include "pepper_flash_clipboard_message_filter_qt.h"
+#include "pepper_isolated_file_system_message_filter.h"
using ppapi::host::MessageFilterHost;
using ppapi::host::ResourceMessageFilter;
@@ -82,6 +92,19 @@ scoped_ptr<ppapi::host::ResourceHost> PepperHostFactoryQt::CreateResourceHost(pp
}
}
+ // Permissions for the following interfaces will be checked at the
+ // time of the corresponding instance's methods calls (because
+ // permission check can be performed only on the UI
+ // thread). Currently these interfaces are available only for
+ // whitelisted apps which may not have access to the other private
+ // interfaces.
+ if (message.type() == PpapiHostMsg_IsolatedFileSystem_Create::ID) {
+ PepperIsolatedFileSystemMessageFilter* isolated_fs_filter = PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
+ if (!isolated_fs_filter)
+ return scoped_ptr<ppapi::host::ResourceHost>();
+ return scoped_ptr<ppapi::host::ResourceHost>(new MessageFilterHost(host, instance, resource, isolated_fs_filter));
+ }
+
return scoped_ptr<ppapi::host::ResourceHost>();
}
diff --git a/src/core/renderer/pepper/pepper_host_factory_qt.h b/src/core/renderer/pepper/pepper_host_factory_qt.h
index 22bf87b1b..e73e097c0 100644
--- a/src/core/renderer/pepper/pepper_host_factory_qt.h
+++ b/src/core/renderer/pepper/pepper_host_factory_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/renderer/pepper/pepper_isolated_file_system_message_filter.cpp b/src/core/renderer/pepper/pepper_isolated_file_system_message_filter.cpp
new file mode 100644
index 000000000..7e8b2fdda
--- /dev/null
+++ b/src/core/renderer/pepper/pepper_isolated_file_system_message_filter.cpp
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This is based on chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc:
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "pepper_isolated_file_system_message_filter.h"
+
+#include "base/macros.h"
+#include "chrome/common/chrome_switches.h"
+#include "content/public/browser/browser_ppapi_host.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/render_view_host.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/host/dispatch_host_message.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/ppapi_host.h"
+#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/file_system_util.h"
+#include "storage/browser/fileapi/isolated_context.h"
+
+namespace QtWebEngineCore {
+
+// static
+PepperIsolatedFileSystemMessageFilter* PepperIsolatedFileSystemMessageFilter::Create(PP_Instance instance, content::BrowserPpapiHost *host)
+{
+ int render_process_id;
+ int unused_render_frame_id;
+ if (!host->GetRenderFrameIDsForInstance(instance, &render_process_id, &unused_render_frame_id))
+ return nullptr;
+ return new PepperIsolatedFileSystemMessageFilter(render_process_id, host->GetPpapiHost());
+}
+
+PepperIsolatedFileSystemMessageFilter::PepperIsolatedFileSystemMessageFilter(int render_process_id,
+ ppapi::host::PpapiHost *ppapi_host)
+ : m_render_process_id(render_process_id),
+ m_ppapi_host(ppapi_host)
+{}
+
+PepperIsolatedFileSystemMessageFilter::~PepperIsolatedFileSystemMessageFilter()
+{}
+
+scoped_refptr<base::TaskRunner> PepperIsolatedFileSystemMessageFilter::OverrideTaskRunnerForMessage(const IPC::Message &)
+{
+ // In order to reach ExtensionSystem, we need to get ProfileManager first.
+ // ProfileManager lives in UI thread, so we need to do this in UI thread.
+ return content::BrowserThread::GetMessageLoopProxyForThread(content::BrowserThread::UI);
+}
+
+int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(const IPC::Message& msg, ppapi::host::HostMessageContext *context)
+{
+ PPAPI_BEGIN_MESSAGE_MAP(PepperIsolatedFileSystemMessageFilter, msg)
+ PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_IsolatedFileSystem_BrowserOpen, OnOpenFileSystem)
+ PPAPI_END_MESSAGE_MAP()
+ return PP_ERROR_FAILED;
+}
+
+int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(ppapi::host::HostMessageContext *context,
+ PP_IsolatedFileSystemType_Private type)
+{
+ switch (type) {
+ case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID:
+ break;
+ case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
+ return PP_ERROR_NOTSUPPORTED;
+ case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
+ return OpenPluginPrivateFileSystem(context);
+ }
+ NOTREACHED();
+ context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(std::string());
+ return PP_ERROR_FAILED;
+}
+
+int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext *context)
+{
+ DCHECK(m_ppapi_host);
+ // Only plugins with private permission can open the filesystem.
+ if (!m_ppapi_host->permissions().HasPermission(ppapi::PERMISSION_PRIVATE))
+ return PP_ERROR_NOACCESS;
+
+ const std::string& root_name = ppapi::IsolatedFileSystemTypeToRootName(PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE);
+ const std::string& fsid =
+ storage::IsolatedContext::GetInstance()->RegisterFileSystemForVirtualPath(
+ storage::kFileSystemTypePluginPrivate, root_name, base::FilePath());
+
+ // Grant full access of isolated filesystem to renderer process.
+ content::ChildProcessSecurityPolicy* policy = content::ChildProcessSecurityPolicy::GetInstance();
+ policy->GrantCreateReadWriteFileSystem(m_render_process_id, fsid);
+
+ context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(fsid);
+ return PP_OK;
+}
+
+} // namespace chrome
diff --git a/src/core/renderer/pepper/pepper_isolated_file_system_message_filter.h b/src/core/renderer/pepper/pepper_isolated_file_system_message_filter.h
new file mode 100644
index 000000000..750f7cea0
--- /dev/null
+++ b/src/core/renderer/pepper/pepper_isolated_file_system_message_filter.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H
+#define PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H
+
+#include "base/macros.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/host/resource_message_filter.h"
+
+namespace content {
+class BrowserPpapiHost;
+}
+
+namespace ppapi {
+namespace host {
+struct HostMessageContext;
+} // namespace host
+} // namespace ppapi
+
+namespace QtWebEngineCore {
+
+class PepperIsolatedFileSystemMessageFilter : public ppapi::host::ResourceMessageFilter {
+public:
+ static PepperIsolatedFileSystemMessageFilter *Create(PP_Instance instance, content::BrowserPpapiHost *host);
+
+ // ppapi::host::ResourceMessageFilter implementation.
+ scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(const IPC::Message &msg) override;
+ int32_t OnResourceMessageReceived(const IPC::Message &msg, ppapi::host::HostMessageContext *context) override;
+
+private:
+ PepperIsolatedFileSystemMessageFilter(int render_process_id, ppapi::host::PpapiHost *ppapi_host);
+
+ ~PepperIsolatedFileSystemMessageFilter() override;
+
+
+ int32_t OnOpenFileSystem(ppapi::host::HostMessageContext *context, PP_IsolatedFileSystemType_Private type);
+ int32_t OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext *context);
+
+ const int m_render_process_id;
+
+ // Not owned by this object.
+ ppapi::host::PpapiHost* m_ppapi_host;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
+};
+
+} // namespace QtWebEngineCore
+
+#endif // PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H
diff --git a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp
index 51416d698..636ca12f1 100644
--- a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp
+++ b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,29 +11,37 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
+// This is based on chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
#include "pepper_renderer_host_factory_qt.h"
#include "pepper_flash_renderer_host_qt.h"
#include "content/public/renderer/renderer_ppapi_host.h"
diff --git a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h
index 8631c1e03..bc472a7c6 100644
--- a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h
+++ b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,8 +40,6 @@
#ifndef PEPPER_RENDERER_HOST_FACTORY_QT_H
#define PEPPER_RENDERER_HOST_FACTORY_QT_H
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "ppapi/host/host_factory.h"
#include "content/public/renderer/render_frame_observer.h"
diff --git a/src/core/renderer/print_web_view_helper_delegate_qt.cpp b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
new file mode 100644
index 000000000..6d74685fe
--- /dev/null
+++ b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "print_web_view_helper_delegate_qt.h"
+
+#include "third_party/WebKit/public/web/WebElement.h"
+
+namespace QtWebEngineCore {
+PrintWebViewHelperDelegateQt::~PrintWebViewHelperDelegateQt()
+{
+
+}
+
+bool PrintWebViewHelperDelegateQt::CancelPrerender(content::RenderView* render_view,
+ int routing_id)
+{
+ return true;
+}
+
+blink::WebElement PrintWebViewHelperDelegateQt::GetPdfElement(blink::WebLocalFrame* frame)
+{
+ return blink::WebElement();
+}
+
+bool PrintWebViewHelperDelegateQt::IsPrintPreviewEnabled()
+{
+ return false;
+}
+
+bool PrintWebViewHelperDelegateQt::OverridePrint(blink::WebLocalFrame* frame)
+{
+ return false;
+}
+
+}
diff --git a/src/core/renderer/print_web_view_helper_delegate_qt.h b/src/core/renderer/print_web_view_helper_delegate_qt.h
new file mode 100644
index 000000000..a854242ba
--- /dev/null
+++ b/src/core/renderer/print_web_view_helper_delegate_qt.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PRINT_WEB_VIEW_HELPER_DELEGATE_QT_H
+#define PRINT_WEB_VIEW_HELPER_DELEGATE_QT_H
+
+#include "components/printing/renderer/print_web_view_helper.h"
+
+namespace QtWebEngineCore {
+
+class PrintWebViewHelperDelegateQt : public printing::PrintWebViewHelper::Delegate
+{
+public:
+ ~PrintWebViewHelperDelegateQt() override;
+
+ bool CancelPrerender(content::RenderView* render_view,
+ int routing_id) override;
+
+ blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override;
+
+ bool IsPrintPreviewEnabled() override;
+
+ bool OverridePrint(blink::WebLocalFrame* frame) override;
+}; // class PrintWebViewHelperDelegateQt
+}
+
+#endif // PRINT_WEB_VIEW_HELPER_DELEGATE_QT_H
+
diff --git a/src/core/renderer/render_frame_observer_qt.cpp b/src/core/renderer/render_frame_observer_qt.cpp
index 8130cc53a..f2285f298 100644
--- a/src/core/renderer/render_frame_observer_qt.cpp
+++ b/src/core/renderer/render_frame_observer_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,29 +11,37 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
+// This is based on chrome/renderer/pepper/pepper_helper.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
#include "render_frame_observer_qt.h"
#include "content/public/renderer/renderer_ppapi_host.h"
diff --git a/src/core/renderer/render_frame_observer_qt.h b/src/core/renderer/render_frame_observer_qt.h
index 4835e442e..b1d59d8c5 100644
--- a/src/core/renderer/render_frame_observer_qt.h
+++ b/src/core/renderer/render_frame_observer_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -37,7 +40,6 @@
#ifndef RENDER_FRAME_OBSERVER_QT_H
#define RENDER_FRAME_OBSERVER_QT_H
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/public/renderer/render_frame_observer.h"
diff --git a/src/core/renderer/render_view_observer_qt.cpp b/src/core/renderer/render_view_observer_qt.cpp
index 47efd07e4..4b44a9bd9 100644
--- a/src/core/renderer/render_view_observer_qt.cpp
+++ b/src/core/renderer/render_view_observer_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/renderer/render_view_observer_qt.h b/src/core/renderer/render_view_observer_qt.h
index 166dcc9ea..4839ae064 100644
--- a/src/core/renderer/render_view_observer_qt.h
+++ b/src/core/renderer/render_view_observer_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/renderer/user_script_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 729500341..30a04958f 100644
--- a/src/core/renderer/user_script_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,30 +11,33 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "user_script_controller.h"
+#include "user_resource_controller.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_observer.h"
@@ -46,14 +49,14 @@
#include "common/qt_messages.h"
#include "common/user_script_data.h"
-Q_GLOBAL_STATIC(UserScriptController, qt_webengine_userScriptController)
+Q_GLOBAL_STATIC(UserResourceController, qt_webengine_userResourceController)
static content::RenderView * const globalScriptsIndex = 0;
// Scripts meant to run after the load event will be run 500ms after DOMContentLoaded if the load event doesn't come within that delay.
static const int afterLoadTimeout = 500;
-class UserScriptController::RenderViewObserverHelper : public content::RenderViewObserver
+class UserResourceController::RenderViewObserverHelper : public content::RenderViewObserver
{
public:
RenderViewObserverHelper(content::RenderView *);
@@ -75,76 +78,76 @@ private:
QSet<blink::WebLocalFrame *> m_pendingFrames;
};
-void UserScriptController::RenderViewObserverHelper::runScripts(UserScriptData::InjectionPoint p, blink::WebLocalFrame *frame)
+void UserResourceController::RenderViewObserverHelper::runScripts(UserScriptData::InjectionPoint p, blink::WebLocalFrame *frame)
{
if (p == UserScriptData::AfterLoad && !m_pendingFrames.remove(frame))
return;
content::RenderView *renderView = content::RenderView::FromWebView(frame->view());
const bool isMainFrame = (frame == renderView->GetWebView()->mainFrame());
- QList<uint64> scriptsToRun = UserScriptController::instance()->m_viewUserScriptMap.value(globalScriptsIndex).toList();
- scriptsToRun.append(UserScriptController::instance()->m_viewUserScriptMap.value(renderView).toList());
+ QList<uint64_t> scriptsToRun = UserResourceController::instance()->m_viewUserScriptMap.value(globalScriptsIndex).toList();
+ scriptsToRun.append(UserResourceController::instance()->m_viewUserScriptMap.value(renderView).toList());
- Q_FOREACH (uint64 id, scriptsToRun) {
- const UserScriptData &script = UserScriptController::instance()->m_scripts.value(id);
+ Q_FOREACH (uint64_t id, scriptsToRun) {
+ const UserScriptData &script = UserResourceController::instance()->m_scripts.value(id);
if (script.injectionPoint != p
|| (!script.injectForSubframes && !isMainFrame))
continue;
blink::WebScriptSource source(blink::WebString::fromUTF8(script.source), script.url);
if (script.worldId)
- frame->executeScriptInIsolatedWorld(script.worldId, &source, /*numSources = */1, /*contentScriptExtentsionGroup = */ 1);
+ frame->executeScriptInIsolatedWorld(script.worldId, &source, /*numSources = */1, /*contentScriptExtentsionGroup = */ 0);
else
frame->executeScript(source);
}
}
-UserScriptController::RenderViewObserverHelper::RenderViewObserverHelper(content::RenderView *renderView)
+UserResourceController::RenderViewObserverHelper::RenderViewObserverHelper(content::RenderView *renderView)
: content::RenderViewObserver(renderView)
{
}
-void UserScriptController::RenderViewObserverHelper::DidCreateDocumentElement(blink::WebLocalFrame *frame)
+void UserResourceController::RenderViewObserverHelper::DidCreateDocumentElement(blink::WebLocalFrame *frame)
{
runScripts(UserScriptData::DocumentElementCreation, frame);
}
-void UserScriptController::RenderViewObserverHelper::DidFinishDocumentLoad(blink::WebLocalFrame *frame)
+void UserResourceController::RenderViewObserverHelper::DidFinishDocumentLoad(blink::WebLocalFrame *frame)
{
runScripts(UserScriptData::DocumentLoadFinished, frame);
m_pendingFrames.insert(frame);
- base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&UserScriptController::RenderViewObserverHelper::runScripts,
+ base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&UserResourceController::RenderViewObserverHelper::runScripts,
base::Unretained(this), UserScriptData::AfterLoad, frame),
base::TimeDelta::FromMilliseconds(afterLoadTimeout));
}
-void UserScriptController::RenderViewObserverHelper::DidFinishLoad(blink::WebLocalFrame *frame)
+void UserResourceController::RenderViewObserverHelper::DidFinishLoad(blink::WebLocalFrame *frame)
{
// DidFinishDocumentLoad always comes before this, so frame has already been marked as pending.
- base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&UserScriptController::RenderViewObserverHelper::runScripts,
+ base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&UserResourceController::RenderViewObserverHelper::runScripts,
base::Unretained(this), UserScriptData::AfterLoad, frame));
}
-void UserScriptController::RenderViewObserverHelper::DidStartProvisionalLoad(blink::WebLocalFrame *frame)
+void UserResourceController::RenderViewObserverHelper::DidStartProvisionalLoad(blink::WebLocalFrame *frame)
{
m_pendingFrames.remove(frame);
}
-void UserScriptController::RenderViewObserverHelper::FrameDetached(blink::WebFrame *frame)
+void UserResourceController::RenderViewObserverHelper::FrameDetached(blink::WebFrame *frame)
{
if (frame->isWebLocalFrame())
m_pendingFrames.remove(frame->toWebLocalFrame());
}
-void UserScriptController::RenderViewObserverHelper::OnDestruct()
+void UserResourceController::RenderViewObserverHelper::OnDestruct()
{
- UserScriptController::instance()->renderViewDestroyed(render_view());
+ UserResourceController::instance()->renderViewDestroyed(render_view());
}
-bool UserScriptController::RenderViewObserverHelper::OnMessageReceived(const IPC::Message &message)
+bool UserResourceController::RenderViewObserverHelper::OnMessageReceived(const IPC::Message &message)
{
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(UserScriptController::RenderViewObserverHelper, message)
+ IPC_BEGIN_MESSAGE_MAP(UserResourceController::RenderViewObserverHelper, message)
IPC_MESSAGE_HANDLER(RenderViewObserverHelper_AddScript, onUserScriptAdded)
IPC_MESSAGE_HANDLER(RenderViewObserverHelper_RemoveScript, onUserScriptRemoved)
IPC_MESSAGE_HANDLER(RenderViewObserverHelper_ClearScripts, onScriptsCleared)
@@ -153,39 +156,39 @@ bool UserScriptController::RenderViewObserverHelper::OnMessageReceived(const IPC
return handled;
}
-void UserScriptController::RenderViewObserverHelper::onUserScriptAdded(const UserScriptData &script)
+void UserResourceController::RenderViewObserverHelper::onUserScriptAdded(const UserScriptData &script)
{
- UserScriptController::instance()->addScriptForView(script, render_view());
+ UserResourceController::instance()->addScriptForView(script, render_view());
}
-void UserScriptController::RenderViewObserverHelper::onUserScriptRemoved(const UserScriptData &script)
+void UserResourceController::RenderViewObserverHelper::onUserScriptRemoved(const UserScriptData &script)
{
- UserScriptController::instance()->removeScriptForView(script, render_view());
+ UserResourceController::instance()->removeScriptForView(script, render_view());
}
-void UserScriptController::RenderViewObserverHelper::onScriptsCleared()
+void UserResourceController::RenderViewObserverHelper::onScriptsCleared()
{
- UserScriptController::instance()->clearScriptsForView(render_view());
+ UserResourceController::instance()->clearScriptsForView(render_view());
}
-UserScriptController *UserScriptController::instance()
+UserResourceController *UserResourceController::instance()
{
- return qt_webengine_userScriptController();
+ return qt_webengine_userResourceController();
}
-bool UserScriptController::OnControlMessageReceived(const IPC::Message &message)
+bool UserResourceController::OnControlMessageReceived(const IPC::Message &message)
{
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(UserScriptController, message)
- IPC_MESSAGE_HANDLER(UserScriptController_AddScript, onAddScript)
- IPC_MESSAGE_HANDLER(UserScriptController_RemoveScript, onRemoveScript)
- IPC_MESSAGE_HANDLER(UserScriptController_ClearScripts, onClearScripts)
+ IPC_BEGIN_MESSAGE_MAP(UserResourceController, message)
+ IPC_MESSAGE_HANDLER(UserResourceController_AddScript, onAddScript)
+ IPC_MESSAGE_HANDLER(UserResourceController_RemoveScript, onRemoveScript)
+ IPC_MESSAGE_HANDLER(UserResourceController_ClearScripts, onClearScripts)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
-UserScriptController::UserScriptController()
+UserResourceController::UserResourceController()
{
#if !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
static bool onlyCalledOnce = true;
@@ -194,24 +197,24 @@ UserScriptController::UserScriptController()
#endif // !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
}
-void UserScriptController::renderViewCreated(content::RenderView *renderView)
+void UserResourceController::renderViewCreated(content::RenderView *renderView)
{
// Will destroy itself with their RenderView.
new RenderViewObserverHelper(renderView);
}
-void UserScriptController::renderViewDestroyed(content::RenderView *renderView)
+void UserResourceController::renderViewDestroyed(content::RenderView *renderView)
{
ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(renderView);
if (it == m_viewUserScriptMap.end()) // ASSERT maybe?
return;
- Q_FOREACH (uint64 id, it.value()) {
+ Q_FOREACH (uint64_t id, it.value()) {
m_scripts.remove(id);
}
m_viewUserScriptMap.remove(renderView);
}
-void UserScriptController::addScriptForView(const UserScriptData &script, content::RenderView *view)
+void UserResourceController::addScriptForView(const UserScriptData &script, content::RenderView *view)
{
ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(view);
if (it == m_viewUserScriptMap.end())
@@ -221,7 +224,7 @@ void UserScriptController::addScriptForView(const UserScriptData &script, conten
m_scripts.insert(script.scriptId, script);
}
-void UserScriptController::removeScriptForView(const UserScriptData &script, content::RenderView *view)
+void UserResourceController::removeScriptForView(const UserScriptData &script, content::RenderView *view)
{
ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(view);
if (it == m_viewUserScriptMap.end())
@@ -231,28 +234,28 @@ void UserScriptController::removeScriptForView(const UserScriptData &script, con
m_scripts.remove(script.scriptId);
}
-void UserScriptController::clearScriptsForView(content::RenderView *view)
+void UserResourceController::clearScriptsForView(content::RenderView *view)
{
ViewUserScriptMap::iterator it = m_viewUserScriptMap.find(view);
if (it == m_viewUserScriptMap.end())
return;
- Q_FOREACH (uint64 id, it.value())
+ Q_FOREACH (uint64_t id, it.value())
m_scripts.remove(id);
m_viewUserScriptMap.remove(view);
}
-void UserScriptController::onAddScript(const UserScriptData &script)
+void UserResourceController::onAddScript(const UserScriptData &script)
{
addScriptForView(script, globalScriptsIndex);
}
-void UserScriptController::onRemoveScript(const UserScriptData &script)
+void UserResourceController::onRemoveScript(const UserScriptData &script)
{
removeScriptForView(script, globalScriptsIndex);
}
-void UserScriptController::onClearScripts()
+void UserResourceController::onClearScripts()
{
clearScriptsForView(globalScriptsIndex);
}
diff --git a/src/core/renderer/user_script_controller.h b/src/core/renderer/user_resource_controller.h
index ed83d9dac..bd3d0ba49 100644
--- a/src/core/renderer/user_script_controller.h
+++ b/src/core/renderer/user_resource_controller.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,31 +11,34 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef USER_SCRIPT_CONTROLLER_H
-#define USER_SCRIPT_CONTROLLER_H
+#ifndef USER_RESOURCE_CONTROLLER_H
+#define USER_RESOURCE_CONTROLLER_H
#include "content/public/renderer/render_process_observer.h"
@@ -50,11 +53,11 @@ class RenderView;
}
-class UserScriptController : public content::RenderProcessObserver {
+class UserResourceController : public content::RenderProcessObserver {
public:
- static UserScriptController *instance();
- UserScriptController();
+ static UserResourceController *instance();
+ UserResourceController();
void renderViewCreated(content::RenderView *);
void renderViewDestroyed(content::RenderView *);
void addScriptForView(const UserScriptData &, content::RenderView *);
@@ -62,7 +65,7 @@ public:
void clearScriptsForView(content::RenderView *);
private:
- Q_DISABLE_COPY(UserScriptController)
+ Q_DISABLE_COPY(UserResourceController)
class RenderViewObserverHelper;
@@ -73,10 +76,10 @@ private:
void onRemoveScript(const UserScriptData &);
void onClearScripts();
- typedef QSet<uint64> UserScriptSet;
+ typedef QSet<uint64_t> UserScriptSet;
typedef QHash<const content::RenderView *, UserScriptSet> ViewUserScriptMap;
ViewUserScriptMap m_viewUserScriptMap;
- QHash<uint64, UserScriptData> m_scripts;
+ QHash<uint64_t, UserScriptData> m_scripts;
};
-#endif // USER_SCRIPT_CONTROLLER_H
+#endif // USER_RESOURCE_CONTROLLER_H
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index 3d844bf0d..6bbbe28bd 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -42,6 +45,10 @@
#include "common/qt_messages.h"
#include "content/public/renderer/render_view.h"
+#include "gin/arguments.h"
+#include "gin/handle.h"
+#include "gin/object_template_builder.h"
+#include "gin/wrappable.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "v8/include/v8.h"
@@ -50,34 +57,23 @@
namespace QtWebEngineCore {
-static const char kWebChannelTransportExtensionName[] = "v8/WebChannelTransport";
-
-static const char kWebChannelTransportApi[] =
- "if (typeof(qt) === 'undefined')" \
- " qt = {};" \
- "if (typeof(qt.webChannelTransport) === 'undefined')" \
- " qt.webChannelTransport = {};" \
- "qt.webChannelTransport.send = function(message) {" \
- " native function NativeQtSendMessage();" \
- " NativeQtSendMessage(message);" \
- "};";
-
-class WebChannelTransportExtension : public v8::Extension {
+class WebChannelTransport : public gin::Wrappable<WebChannelTransport> {
public:
- static content::RenderView *GetRenderView();
-
- WebChannelTransportExtension() : v8::Extension(kWebChannelTransportExtensionName, kWebChannelTransportApi)
+ static gin::WrapperInfo kWrapperInfo;
+ static void Install(blink::WebFrame *frame, uint worldId);
+ static void Uninstall(blink::WebFrame *frame, uint worldId);
+private:
+ content::RenderView *GetRenderView(v8::Isolate *isolate);
+ WebChannelTransport() { }
+ virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate *isolate) override;
+
+ void NativeQtSendMessage(gin::Arguments *args)
{
- }
-
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(v8::Isolate* isolate, v8::Handle<v8::String> name) Q_DECL_OVERRIDE;
-
- static void NativeQtSendMessage(const v8::FunctionCallbackInfo<v8::Value>& args)
- {
- content::RenderView *renderView = GetRenderView();
- if (!renderView || args.Length() != 1)
+ content::RenderView *renderView = GetRenderView(args->isolate());
+ if (!renderView || args->Length() != 1)
return;
- v8::Handle<v8::Value> val = args[0];
+ v8::Handle<v8::Value> val;
+ args->GetNext(&val);
if (!val->IsString() && !val->IsStringObject())
return;
v8::String::Utf8Value utf8(val->ToString());
@@ -91,11 +87,59 @@ public:
const char *rawData = doc.rawData(&size);
renderView->Send(new WebChannelIPCTransportHost_SendMessage(renderView->GetRoutingID(), std::vector<char>(rawData, rawData + size)));
}
+
+ DISALLOW_COPY_AND_ASSIGN(WebChannelTransport);
};
-content::RenderView *WebChannelTransportExtension::GetRenderView()
+gin::WrapperInfo WebChannelTransport::kWrapperInfo = { gin::kEmbedderNativeGin };
+
+void WebChannelTransport::Install(blink::WebFrame *frame, uint worldId)
{
- blink::WebLocalFrame *webframe = blink::WebLocalFrame::frameForCurrentContext();
+ v8::Isolate *isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope handleScope(isolate);
+ v8::Handle<v8::Context> context;
+ if (worldId == 0)
+ context = frame->mainWorldScriptContext();
+ else
+ context = frame->toWebLocalFrame()->isolatedWorldScriptContext(worldId, 0);
+ v8::Context::Scope contextScope(context);
+
+ gin::Handle<WebChannelTransport> transport = gin::CreateHandle(isolate, new WebChannelTransport);
+ v8::Handle<v8::Object> global = context->Global();
+ v8::Handle<v8::Object> qt = global->Get(gin::StringToV8(isolate, "qt"))->ToObject();
+ if (qt.IsEmpty()) {
+ qt = v8::Object::New(isolate);
+ global->Set(gin::StringToV8(isolate, "qt"), qt);
+ }
+ qt->Set(gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8());
+}
+
+void WebChannelTransport::Uninstall(blink::WebFrame *frame, uint worldId)
+{
+ v8::Isolate *isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope handleScope(isolate);
+ v8::Handle<v8::Context> context;
+ if (worldId == 0)
+ context = frame->mainWorldScriptContext();
+ else
+ context = frame->toWebLocalFrame()->isolatedWorldScriptContext(worldId, 0);
+ v8::Context::Scope contextScope(context);
+
+ v8::Handle<v8::Object> global(context->Global());
+ v8::Handle<v8::Object> qt = global->Get(gin::StringToV8(isolate, "qt"))->ToObject();
+ if (qt.IsEmpty())
+ return;
+ qt->Delete(gin::StringToV8(isolate, "webChannelTransport"));
+}
+
+gin::ObjectTemplateBuilder WebChannelTransport::GetObjectTemplateBuilder(v8::Isolate *isolate)
+{
+ return gin::Wrappable<WebChannelTransport>::GetObjectTemplateBuilder(isolate).SetMethod("send", &WebChannelTransport::NativeQtSendMessage);
+}
+
+content::RenderView *WebChannelTransport::GetRenderView(v8::Isolate *isolate)
+{
+ blink::WebLocalFrame *webframe = blink::WebLocalFrame::frameForContext(isolate->GetCurrentContext());
DCHECK(webframe) << "There should be an active frame since we just got a native function called.";
if (!webframe)
return 0;
@@ -107,20 +151,33 @@ content::RenderView *WebChannelTransportExtension::GetRenderView()
return content::RenderView::FromWebView(webview);
}
-v8::Handle<v8::FunctionTemplate> WebChannelTransportExtension::GetNativeFunctionTemplate(v8::Isolate *isolate, v8::Handle<v8::String> name)
+WebChannelIPCTransport::WebChannelIPCTransport(content::RenderView *renderView)
+ : content::RenderViewObserver(renderView)
+ , m_installed(false)
+ , m_installedWorldId(0)
{
- if (name->Equals(v8::String::NewFromUtf8(isolate, "NativeQtSendMessage")))
- return v8::FunctionTemplate::New(isolate, NativeQtSendMessage);
+}
- return v8::Handle<v8::FunctionTemplate>();
+void WebChannelIPCTransport::installWebChannel(uint worldId)
+{
+ blink::WebView *webView = render_view()->GetWebView();
+ if (!webView)
+ return;
+ WebChannelTransport::Install(webView->mainFrame(), worldId);
+ m_installed = true;
+ m_installedWorldId = worldId;
}
-WebChannelIPCTransport::WebChannelIPCTransport(content::RenderView *renderView)
- : content::RenderViewObserver(renderView)
+void WebChannelIPCTransport::uninstallWebChannel(uint worldId)
{
+ blink::WebView *webView = render_view()->GetWebView();
+ if (!webView)
+ return;
+ WebChannelTransport::Uninstall(webView->mainFrame(), worldId);
+ m_installed = false;
}
-void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector<char> &binaryJSON)
+void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector<char> &binaryJSON, uint worldId)
{
blink::WebView *webView = render_view()->GetWebView();
if (!webView)
@@ -133,17 +190,21 @@ void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector<char> &
v8::Isolate *isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
blink::WebFrame *frame = webView->mainFrame();
- v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
+ v8::Handle<v8::Context> context;
+ if (worldId == 0)
+ context = frame->mainWorldScriptContext();
+ else
+ context = frame->toWebLocalFrame()->isolatedWorldScriptContext(worldId, 0);
v8::Context::Scope contextScope(context);
v8::Handle<v8::Object> global(context->Global());
- v8::Handle<v8::Value> qtObjectValue(global->Get(v8::String::NewFromUtf8(isolate, "qt")));
+ v8::Handle<v8::Value> qtObjectValue(global->Get(gin::StringToV8(isolate, "qt")));
if (!qtObjectValue->IsObject())
return;
- v8::Handle<v8::Value> webChannelObjectValue(qtObjectValue->ToObject()->Get(v8::String::NewFromUtf8(isolate, "webChannelTransport")));
+ v8::Handle<v8::Value> webChannelObjectValue(qtObjectValue->ToObject()->Get(gin::StringToV8(isolate, "webChannelTransport")));
if (!webChannelObjectValue->IsObject())
return;
- v8::Handle<v8::Value> onmessageCallbackValue(webChannelObjectValue->ToObject()->Get(v8::String::NewFromUtf8(isolate, "onmessage")));
+ v8::Handle<v8::Value> onmessageCallbackValue(webChannelObjectValue->ToObject()->Get(gin::StringToV8(isolate, "onmessage")));
if (!onmessageCallbackValue->IsFunction()) {
qWarning("onmessage is not a callable property of qt.webChannelTransport. Some things might not work as expected.");
return;
@@ -161,15 +222,19 @@ void WebChannelIPCTransport::dispatchWebChannelMessage(const std::vector<char> &
frame->callFunctionEvenIfScriptDisabled(callback, webChannelObjectValue->ToObject(), argc, argv);
}
-v8::Extension *WebChannelIPCTransport::getV8Extension()
+void WebChannelIPCTransport::DidCreateDocumentElement(blink::WebLocalFrame* frame)
{
- return new WebChannelTransportExtension;
+ blink::WebFrame* main_frame = render_view()->GetWebView()->mainFrame();
+ if (m_installed && frame == main_frame)
+ WebChannelTransport::Install(frame, m_installedWorldId);
}
bool WebChannelIPCTransport::OnMessageReceived(const IPC::Message &message)
{
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebChannelIPCTransport, message)
+ IPC_MESSAGE_HANDLER(WebChannelIPCTransport_Install, installWebChannel)
+ IPC_MESSAGE_HANDLER(WebChannelIPCTransport_Uninstall, uninstallWebChannel)
IPC_MESSAGE_HANDLER(WebChannelIPCTransport_Message, dispatchWebChannelMessage)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
diff --git a/src/core/renderer/web_channel_ipc_transport.h b/src/core/renderer/web_channel_ipc_transport.h
index 69a02f7ea..fcee13bda 100644
--- a/src/core/renderer/web_channel_ipc_transport.h
+++ b/src/core/renderer/web_channel_ipc_transport.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -49,13 +52,17 @@ namespace QtWebEngineCore {
class WebChannelIPCTransport : public content::RenderViewObserver {
public:
- static v8::Extension* getV8Extension();
-
WebChannelIPCTransport(content::RenderView *);
private:
- void dispatchWebChannelMessage(const std::vector<char> &binaryJSON);
+ void dispatchWebChannelMessage(const std::vector<char> &binaryJSON, uint worldId);
+ void installWebChannel(uint worldId);
+ void uninstallWebChannel(uint worldId);
+ virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) override;
virtual bool OnMessageReceived(const IPC::Message &message) Q_DECL_OVERRIDE;
+
+ bool m_installed;
+ uint m_installedWorldId;
};
} // namespace
diff --git a/src/core/resource_bundle_qt.cpp b/src/core/resource_bundle_qt.cpp
index 932f40af8..fa5c04524 100644
--- a/src/core/resource_bundle_qt.cpp
+++ b/src/core/resource_bundle_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -47,6 +50,7 @@ void ResourceBundle::LoadCommonResources()
AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_PAK), SCALE_FACTOR_NONE);
AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_100P_PAK), SCALE_FACTOR_100P);
AddDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_200P_PAK), SCALE_FACTOR_200P);
+ AddOptionalDataPackFromPath(WebEngineLibraryInfo::getPath(QT_RESOURCES_DEVTOOLS_PAK), SCALE_FACTOR_NONE);
}
gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl)
diff --git a/src/core/resource_context_qt.cpp b/src/core/resource_context_qt.cpp
index 715d92aa2..5cb217605 100644
--- a/src/core/resource_context_qt.cpp
+++ b/src/core/resource_context_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/resource_context_qt.h b/src/core/resource_context_qt.h
index 22bceb8e7..a6f573cef 100644
--- a/src/core/resource_context_qt.h
+++ b/src/core/resource_context_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/resource_dispatcher_host_delegate_qt.cpp b/src/core/resource_dispatcher_host_delegate_qt.cpp
index 0213daa3a..af8b02e1b 100644
--- a/src/core/resource_dispatcher_host_delegate_qt.cpp
+++ b/src/core/resource_dispatcher_host_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -89,7 +92,7 @@ QString ResourceDispatcherHostLoginDelegateQt::realm() const
QString ResourceDispatcherHostLoginDelegateQt::host() const
{
- return QString::fromStdString(m_authInfo->challenger.ToString());
+ return QString::fromStdString(m_authInfo->challenger.host());
}
bool ResourceDispatcherHostLoginDelegateQt::isProxy() const
@@ -133,21 +136,21 @@ void ResourceDispatcherHostLoginDelegateQt::destroy()
m_request = 0;
}
-static void LaunchURL(const GURL& url, int render_process_id, int render_view_id,
+static void LaunchURL(const GURL& url, int render_process_id,
+ const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
ui::PageTransition page_transition, bool is_main_frame)
{
+ Q_UNUSED(render_process_id);
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- content::RenderViewHost *render_view_host = content::RenderViewHost::FromID(render_process_id, render_view_id);
- if (!render_view_host)
- return;
- content::WebContents* webContents = content::WebContents::FromRenderViewHost(render_view_host);
+ content::WebContents* webContents = web_contents_getter.Run();
if (!webContents)
return;
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
contentsDelegate->launchExternalURL(toQt(url), page_transition, is_main_frame);
}
-bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, int child_id, int route_id,
+bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, int child_id,
+ const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture)
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
@@ -158,7 +161,7 @@ bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, i
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
- base::Bind(&LaunchURL, url, child_id, route_id, page_transition, is_main_frame));
+ base::Bind(&LaunchURL, url, child_id, web_contents_getter, page_transition, is_main_frame));
return true;
}
diff --git a/src/core/resource_dispatcher_host_delegate_qt.h b/src/core/resource_dispatcher_host_delegate_qt.h
index 49e69ecf9..90797dbbf 100644
--- a/src/core/resource_dispatcher_host_delegate_qt.h
+++ b/src/core/resource_dispatcher_host_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -86,8 +89,10 @@ private:
class ResourceDispatcherHostDelegateQt : public content::ResourceDispatcherHostDelegate {
public:
- virtual bool HandleExternalProtocol(const GURL& url, int child_id, int route_id,
- bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture) Q_DECL_OVERRIDE;
+ virtual bool HandleExternalProtocol(const GURL& url,int child_id,
+ const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
+ bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture)
+ Q_DECL_OVERRIDE;
virtual content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(net::AuthChallengeInfo *authInfo, net::URLRequest *request) Q_DECL_OVERRIDE;
};
diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp
index 9dcdaf0d1..618b4d355 100644
--- a/src/core/resources/resources.gyp
+++ b/src/core/resources/resources.gyp
@@ -20,6 +20,7 @@
'dependencies': [
'<(chromium_src_dir)/content/app/strings/content_strings.gyp:content_strings',
'<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
+ '<(chromium_src_dir)/components/components_strings.gyp:components_strings',
'<(chromium_src_dir)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
'<(qtwebengine_root)/src/core/chrome_qt.gyp:chrome_resources',
],
@@ -29,7 +30,6 @@
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
- '<(SHARED_INTERMEDIATE_DIR)/blink/devtools_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
@@ -71,6 +71,18 @@
'includes': [ 'repack_resources.gypi' ],
},
{
+ 'action_name': 'repack_resources_devtools',
+ 'variables': {
+ 'pak_inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/blink/devtools_resources.pak',
+ ],
+ 'pak_outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_devtools_resources.pak'
+ ]
+ },
+ 'includes': [ 'repack_resources.gypi' ],
+ },
+ {
'action_name': 'repack_locales',
'includes': [ 'repack_locales.gypi' ],
},
diff --git a/src/core/stream_video_node.cpp b/src/core/stream_video_node.cpp
index fdae5fee2..81b76a296 100644
--- a/src/core/stream_video_node.cpp
+++ b/src/core/stream_video_node.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/stream_video_node.h b/src/core/stream_video_node.h
index 92c640811..46a433835 100644
--- a/src/core/stream_video_node.h
+++ b/src/core/stream_video_node.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp
index db10be070..48c91bfcf 100644
--- a/src/core/surface_factory_qt.cpp
+++ b/src/core/surface_factory_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/surface_factory_qt.h b/src/core/surface_factory_qt.h
index 26cbf9a01..d65680a4a 100644
--- a/src/core/surface_factory_qt.h
+++ b/src/core/surface_factory_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index 705d22aed..ef220b86c 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -36,6 +39,10 @@
#include "type_conversion.h"
+#include <ui/events/event_constants.h>
+#include <ui/gfx/image/image_skia.h>
+#include <QtCore/qcoreapplication.h>
+
namespace QtWebEngineCore {
QImage toQImage(const SkBitmap &bitmap)
@@ -113,4 +120,81 @@ QImage toQImage(const SkBitmap &bitmap)
return image;
}
+QImage toQImage(const gfx::ImageSkiaRep &imageSkiaRep)
+{
+ QImage image = toQImage(imageSkiaRep.sk_bitmap());
+ if (!image.isNull() && imageSkiaRep.scale() != 1.0f)
+ image.setDevicePixelRatio(imageSkiaRep.scale());
+ return image;
+}
+
+QIcon toQIcon(const std::vector<SkBitmap> &bitmaps)
+{
+ if (!bitmaps.size())
+ return QIcon();
+
+ QIcon icon;
+
+ for (unsigned i = 0; i < bitmaps.size(); ++i) {
+ SkBitmap bitmap = bitmaps[i];
+ QImage image = toQImage(bitmap);
+
+ icon.addPixmap(QPixmap::fromImage(image).copy());
+ }
+
+ return icon;
+}
+
+int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
+{
+ int modifierFlags = ui::EF_NONE;
+#if defined(Q_OS_OSX)
+ if (!qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
+ if ((modifiers & Qt::ControlModifier) != 0)
+ modifierFlags |= ui::EF_COMMAND_DOWN;
+ if ((modifiers & Qt::MetaModifier) != 0)
+ modifierFlags |= ui::EF_CONTROL_DOWN;
+ } else
+#endif
+ {
+ if ((modifiers & Qt::ControlModifier) != 0)
+ modifierFlags |= ui::EF_CONTROL_DOWN;
+ if ((modifiers & Qt::MetaModifier) != 0)
+ modifierFlags |= ui::EF_COMMAND_DOWN;
+ }
+ if ((modifiers & Qt::ShiftModifier) != 0)
+ modifierFlags |= ui::EF_SHIFT_DOWN;
+ if ((modifiers & Qt::AltModifier) != 0)
+ modifierFlags |= ui::EF_ALT_DOWN;
+ return modifierFlags;
+}
+
+FaviconInfo toFaviconInfo(const content::FaviconURL &favicon_url)
+{
+ FaviconInfo info;
+
+ info.url = toQt(favicon_url.icon_url);
+
+ switch (favicon_url.icon_type) {
+ case content::FaviconURL::FAVICON:
+ info.type = FaviconInfo::Favicon;
+ break;
+ case content::FaviconURL::TOUCH_ICON:
+ info.type = FaviconInfo::TouchIcon;
+ break;
+ case content::FaviconURL::TOUCH_PRECOMPOSED_ICON:
+ info.type = FaviconInfo::TouchPrecomposedIcon;
+ break;
+ default:
+ info.type = FaviconInfo::InvalidIcon;
+ break;
+ }
+
+ // TODO: Add support for rel sizes attribute (favicon_url.icon_sizes):
+ // http://www.w3schools.com/tags/att_link_sizes.asp
+ info.size = QSize(0, 0);
+
+ return info;
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index a08c4c26f..e96a544e5 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,23 +43,32 @@
#include <QColor>
#include <QDateTime>
#include <QDir>
+#include <QIcon>
#include <QImage>
#include <QMatrix4x4>
#include <QNetworkCookie>
#include <QRect>
#include <QString>
#include <QUrl>
+#include <base/strings/nullable_string16.h>
#include "base/files/file_path.h"
#include "base/time/time.h"
#include "content/public/common/file_chooser_file_info.h"
+#include "content/public/common/favicon_url.h"
+#include "favicon_manager.h"
#include "net/cookies/canonical_cookie.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkPixelRef.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/rect_f.h"
#include "url/gurl.h"
+namespace gfx {
+class ImageSkiaRep;
+}
+
namespace QtWebEngineCore {
inline QString toQt(const base::string16 &string)
@@ -87,6 +99,11 @@ inline base::string16 toString16(const QString &qString)
#endif
}
+inline base::NullableString16 toNullableString16(const QString &qString)
+{
+ return base::NullableString16(toString16(qString), qString.isNull());
+}
+
inline QUrl toQt(const GURL &url)
{
return QUrl(QString::fromStdString(url.spec()));
@@ -102,6 +119,11 @@ inline QPoint toQt(const gfx::Point &point)
return QPoint(point.x(), point.y());
}
+inline QPointF toQt(const gfx::Vector2dF &point)
+{
+ return QPointF(point.x(), point.y());
+}
+
inline gfx::Point toGfx(const QPoint& point)
{
return gfx::Point(point.x(), point.y());
@@ -149,6 +171,8 @@ inline QImage toQImage(const SkBitmap &bitmap, QImage::Format format)
}
QImage toQImage(const SkBitmap &bitmap);
+QImage toQImage(const gfx::ImageSkiaRep &imageSkiaRep);
+QIcon toQIcon(const std::vector<SkBitmap> &bitmaps);
inline QMatrix4x4 toQt(const SkMatrix44 &m)
{
@@ -233,6 +257,19 @@ inline std::vector<T> toVector(const QStringList &fileList)
return selectedFiles;
}
+int flagsFromModifiers(Qt::KeyboardModifiers modifiers);
+
+inline QStringList fromVector(const std::vector<base::string16> &vector)
+{
+ QStringList result;
+ for (auto s: vector) {
+ result.append(toQt(s));
+ }
+ return result;
+}
+
+FaviconInfo toFaviconInfo(const content::FaviconURL &);
+
} // namespace QtWebEngineCore
#endif // TYPE_CONVERSION_H
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index db2240eb4..bf32c75a4 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -45,6 +48,7 @@
#include "content/public/common/content_switches.h"
#include "net/base/cache_type.h"
#include "net/cert/cert_verifier.h"
+#include "net/disk_cache/disk_cache.h"
#include "net/dns/host_resolver.h"
#include "net/dns/mapped_host_resolver.h"
#include "net/extras/sqlite/sqlite_channel_id_store.h"
@@ -98,7 +102,7 @@ URLRequestContextGetterQt::URLRequestContextGetterQt(QSharedPointer<BrowserConte
, m_browserContext(browserContext)
, m_baseJobFactory(0)
, m_cookieDelegate(new CookieMonsterDelegateQt())
- , m_requestInterceptors(request_interceptors.Pass())
+ , m_requestInterceptors(std::move(request_interceptors))
{
std::swap(m_protocolHandlers, *protocolHandlers);
@@ -229,7 +233,7 @@ void URLRequestContextGetterQt::generateStorage()
m_dhcpProxyScriptFetcherFactory.reset(new net::DhcpProxyScriptFetcherFactory);
m_storage->set_proxy_service(net::CreateProxyServiceUsingV8ProxyResolver(
- proxyConfigService,
+ scoped_ptr<net::ProxyConfigService>(proxyConfigService),
new net::ProxyScriptFetcherImpl(m_urlRequestContext.get()),
m_dhcpProxyScriptFetcherFactory->Create(m_urlRequestContext.get()),
host_resolver.get(),
@@ -237,13 +241,13 @@ void URLRequestContextGetterQt::generateStorage()
m_networkDelegate.get()));
m_storage->set_ssl_config_service(new net::SSLConfigServiceDefaults);
- m_storage->set_transport_security_state(new net::TransportSecurityState());
+ m_storage->set_transport_security_state(scoped_ptr<net::TransportSecurityState>(new net::TransportSecurityState()));
m_storage->set_http_auth_handler_factory(net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
m_storage->set_http_server_properties(scoped_ptr<net::HttpServerProperties>(new net::HttpServerPropertiesImpl));
// Give |m_storage| ownership at the end in case it's |mapped_host_resolver|.
- m_storage->set_host_resolver(host_resolver.Pass());
+ m_storage->set_host_resolver(std::move(host_resolver));
}
void URLRequestContextGetterQt::updateCookieStore()
@@ -347,8 +351,8 @@ void URLRequestContextGetterQt::generateUserAgent()
QMutexLocker lock(&m_mutex);
m_updateUserAgent = true;
- m_storage->set_http_user_agent_settings(
- new net::StaticHttpUserAgentSettings(m_httpAcceptLanguage.toStdString(), m_httpUserAgent.toStdString()));
+ m_storage->set_http_user_agent_settings(scoped_ptr<net::HttpUserAgentSettings>(
+ new net::StaticHttpUserAgentSettings(m_httpAcceptLanguage.toStdString(), m_httpUserAgent.toStdString())));
}
void URLRequestContextGetterQt::updateHttpCache()
@@ -465,22 +469,39 @@ void URLRequestContextGetterQt::generateHttpCache()
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)
);
break;
+ case BrowserContextAdapter::NoCache:
+ // It's safe to not create BackendFactory.
+ break;
}
net::HttpCache *cache = 0;
- net::HttpNetworkSession *network_session = 0;
net::HttpNetworkSession::Params network_session_params = generateNetworkSessionParams();
- if (m_urlRequestContext->http_transaction_factory())
- network_session = m_urlRequestContext->http_transaction_factory()->GetSession();
-
- if (!network_session || !doNetworkSessionParamsMatch(network_session_params, network_session->params())) {
+ if (!m_httpNetworkSession || !doNetworkSessionParamsMatch(network_session_params, m_httpNetworkSession->params())) {
cancelAllUrlRequests();
- cache = new net::HttpCache(network_session_params, main_backend);
- } else
- cache = new net::HttpCache(network_session, main_backend);
+ m_httpNetworkSession.reset(new net::HttpNetworkSession(network_session_params));
+ }
+
+ cache = new net::HttpCache(m_httpNetworkSession.get(), scoped_ptr<net::HttpCache::DefaultBackend>(main_backend), false);
+
+ m_storage->set_http_transaction_factory(scoped_ptr<net::HttpCache>(cache));
+}
- m_storage->set_http_transaction_factory(cache);
+void URLRequestContextGetterQt::clearHttpCache()
+{
+ if (m_urlRequestContext)
+ content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestContextGetterQt::clearCurrentCacheBackend, this));
+}
+
+static void doomCallback(int error_code) { Q_UNUSED(error_code); }
+
+void URLRequestContextGetterQt::clearCurrentCacheBackend()
+{
+ if (m_urlRequestContext->http_transaction_factory() && m_urlRequestContext->http_transaction_factory()->GetCache()) {
+ disk_cache::Backend *backend = m_urlRequestContext->http_transaction_factory()->GetCache()->GetCurrentBackend();
+ if (backend)
+ backend->DoomAllEntries(base::Bind(&doomCallback));
+ }
}
void URLRequestContextGetterQt::generateJobFactory()
@@ -498,34 +519,34 @@ void URLRequestContextGetterQt::generateJobFactory()
// Chromium has a few protocol handlers ready for us, only pick blob: and throw away the rest.
content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme);
Q_ASSERT(it != m_protocolHandlers.end());
- jobFactory->SetProtocolHandler(it->first, it->second.release());
+ jobFactory->SetProtocolHandler(it->first, scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release()));
m_protocolHandlers.clear();
}
- jobFactory->SetProtocolHandler(url::kDataScheme, new net::DataProtocolHandler());
- jobFactory->SetProtocolHandler(url::kFileScheme, new net::FileProtocolHandler(
+ jobFactory->SetProtocolHandler(url::kDataScheme, scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::DataProtocolHandler()));
+ jobFactory->SetProtocolHandler(url::kFileScheme, scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::FileProtocolHandler(
content::BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
- jobFactory->SetProtocolHandler(kQrcSchemeQt, new QrcProtocolHandlerQt());
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
+ jobFactory->SetProtocolHandler(kQrcSchemeQt, scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(new QrcProtocolHandlerQt()));
jobFactory->SetProtocolHandler(url::kFtpScheme,
- new net::FtpProtocolHandler(new net::FtpNetworkLayer(m_urlRequestContext->host_resolver())));
+ scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::FtpProtocolHandler(new net::FtpNetworkLayer(m_urlRequestContext->host_resolver()))));
m_installedCustomSchemes = m_customUrlSchemes;
Q_FOREACH (const QByteArray &scheme, m_installedCustomSchemes) {
- jobFactory->SetProtocolHandler(scheme.toStdString(), new CustomProtocolHandler(m_browserContext));
+ jobFactory->SetProtocolHandler(scheme.toStdString(), scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(new CustomProtocolHandler(m_browserContext)));
}
m_baseJobFactory = jobFactory.get();
// Set up interceptors in the reverse order.
- scoped_ptr<net::URLRequestJobFactory> topJobFactory = jobFactory.Pass();
+ scoped_ptr<net::URLRequestJobFactory> topJobFactory = std::move(jobFactory);
for (content::URLRequestInterceptorScopedVector::reverse_iterator i = m_requestInterceptors.rbegin(); i != m_requestInterceptors.rend(); ++i)
- topJobFactory.reset(new net::URLRequestInterceptingJobFactory(topJobFactory.Pass(), make_scoped_ptr(*i)));
+ topJobFactory.reset(new net::URLRequestInterceptingJobFactory(std::move(topJobFactory), make_scoped_ptr(*i)));
m_requestInterceptors.weak_clear();
- m_jobFactory = topJobFactory.Pass();
+ m_jobFactory = std::move(topJobFactory);
m_urlRequestContext->set_job_factory(m_jobFactory.get());
}
@@ -549,7 +570,7 @@ void URLRequestContextGetterQt::regenerateJobFactory()
m_installedCustomSchemes = m_customUrlSchemes;
Q_FOREACH (const QByteArray &scheme, m_installedCustomSchemes) {
- m_baseJobFactory->SetProtocolHandler(scheme.toStdString(), new CustomProtocolHandler(m_browserContext));
+ m_baseJobFactory->SetProtocolHandler(scheme.toStdString(), scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(new CustomProtocolHandler(m_browserContext)));
}
}
diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h
index 9a4c74303..dd51fd72c 100644
--- a/src/core/url_request_context_getter_qt.h
+++ b/src/core/url_request_context_getter_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -78,6 +81,7 @@ public:
void updateUserAgent();
void updateCookieStore();
void updateHttpCache();
+ void clearHttpCache();
void updateJobFactory();
void updateRequestInterceptor();
@@ -92,6 +96,7 @@ private:
void generateUserAgent();
void generateJobFactory();
void regenerateJobFactory();
+ void clearCurrentCacheBackend();
void cancelAllUrlRequests();
net::HttpNetworkSession::Params generateNetworkSessionParams();
@@ -119,6 +124,7 @@ private:
scoped_ptr<net::DhcpProxyScriptFetcherFactory> m_dhcpProxyScriptFetcherFactory;
scoped_refptr<CookieMonsterDelegateQt> m_cookieDelegate;
content::URLRequestInterceptorScopedVector m_requestInterceptors;
+ scoped_ptr<net::HttpNetworkSession> m_httpNetworkSession;
QList<QByteArray> m_installedCustomSchemes;
QWebEngineUrlRequestInterceptor* m_requestInterceptor;
diff --git a/src/core/url_request_custom_job.cpp b/src/core/url_request_custom_job.cpp
index 493bdb703..887222285 100644
--- a/src/core/url_request_custom_job.cpp
+++ b/src/core/url_request_custom_job.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -130,22 +133,25 @@ bool URLRequestCustomJob::IsRedirectResponse(GURL* location, int* http_status_co
return false;
}
-bool URLRequestCustomJob::ReadRawData(IOBuffer *buf, int bufSize, int *bytesRead)
+int URLRequestCustomJob::ReadRawData(IOBuffer *buf, int bufSize)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- Q_ASSERT(bytesRead);
Q_ASSERT(m_shared);
QMutexLocker lock(&m_shared->m_mutex);
+ if (m_shared->m_error)
+ return m_shared->m_error;
qint64 rv = m_shared->m_device ? m_shared->m_device->read(buf->data(), bufSize) : -1;
- if (rv >= 0) {
- *bytesRead = static_cast<int>(rv);
- return true;
- } else {
- NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, ERR_FAILED));
+ if (rv >= 0)
+ return static_cast<int>(rv);
+ else {
+ // QIODevice::read might have called fail on us.
+ if (m_shared->m_error)
+ return m_shared->m_error;
+ return ERR_FAILED;
}
- return false;
}
+
URLRequestCustomJobShared::URLRequestCustomJobShared(URLRequestCustomJob *job)
: m_mutex(QMutex::Recursive)
, m_job(job)
@@ -261,7 +267,7 @@ void URLRequestCustomJobShared::notifyCanceled()
if (!m_job)
return;
if (m_started)
- m_job->NotifyDone(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED));
+ m_job->NotifyCanceled();
else
m_job->NotifyStartError(URLRequestStatus(URLRequestStatus::CANCELED, ERR_ABORTED));
}
@@ -279,9 +285,11 @@ void URLRequestCustomJobShared::notifyStarted()
void URLRequestCustomJobShared::fail(int error)
{
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
QMutexLocker lock(&m_mutex);
m_error = error;
+ if (content::BrowserThread::CurrentlyOn(content::BrowserThread::IO))
+ return;
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!m_job)
return;
content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, base::Bind(&URLRequestCustomJobShared::notifyFailure, m_weakFactory.GetWeakPtr()));
@@ -295,13 +303,9 @@ void URLRequestCustomJobShared::notifyFailure()
return;
if (m_device)
m_device->close();
- const URLRequestStatus status(URLRequestStatus::FAILED, m_error);
- const bool started = m_started;
-
- if (started)
- m_job->NotifyDone(status);
- else
- m_job->NotifyStartError(status);
+ if (!m_started)
+ m_job->NotifyStartError(URLRequestStatus::FromError(m_error));
+ // else we fail on the next read, or the read that might already be in progress
}
GURL URLRequestCustomJobShared::requestUrl()
diff --git a/src/core/url_request_custom_job.h b/src/core/url_request_custom_job.h
index be1598ccc..3fce76d36 100644
--- a/src/core/url_request_custom_job.h
+++ b/src/core/url_request_custom_job.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -58,7 +61,7 @@ public:
URLRequestCustomJob(net::URLRequest *request, net::NetworkDelegate *networkDelegate, const std::string &scheme, QWeakPointer<const BrowserContextAdapter> adapter);
virtual void Start() Q_DECL_OVERRIDE;
virtual void Kill() Q_DECL_OVERRIDE;
- virtual bool ReadRawData(net::IOBuffer *buf, int bufSize, int *bytesRead) Q_DECL_OVERRIDE;
+ virtual int ReadRawData(net::IOBuffer *buf, int buf_size) Q_DECL_OVERRIDE;
virtual bool GetMimeType(std::string *mimeType) const Q_DECL_OVERRIDE;
virtual bool GetCharset(std::string *charset) Q_DECL_OVERRIDE;
virtual bool IsRedirectResponse(GURL* location, int* http_status_code) Q_DECL_OVERRIDE;
diff --git a/src/core/url_request_custom_job_delegate.cpp b/src/core/url_request_custom_job_delegate.cpp
index 1a3e08e52..7e806a4e0 100644
--- a/src/core/url_request_custom_job_delegate.cpp
+++ b/src/core/url_request_custom_job_delegate.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/url_request_custom_job_delegate.h b/src/core/url_request_custom_job_delegate.h
index e066e85cc..7752d979e 100644
--- a/src/core/url_request_custom_job_delegate.h
+++ b/src/core/url_request_custom_job_delegate.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/url_request_qrc_job_qt.cpp b/src/core/url_request_qrc_job_qt.cpp
index 617b894ea..ffe9b6dc6 100644
--- a/src/core/url_request_qrc_job_qt.cpp
+++ b/src/core/url_request_qrc_job_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -86,27 +89,22 @@ bool URLRequestQrcJobQt::GetMimeType(std::string *mimeType) const
return false;
}
-bool URLRequestQrcJobQt::ReadRawData(IOBuffer *buf, int bufSize, int *bytesRead)
+int URLRequestQrcJobQt::ReadRawData(IOBuffer *buf, int bufSize)
{
- DCHECK(bytesRead);
DCHECK_GE(m_remainingBytes, 0);
// File has been read finished.
if (!m_remainingBytes || !bufSize) {
- *bytesRead = 0;
- return true;
+ return 0;
}
if (m_remainingBytes < bufSize)
bufSize = static_cast<int>(m_remainingBytes);
qint64 rv = m_file.read(buf->data(), bufSize);
if (rv >= 0) {
- *bytesRead = static_cast<int>(rv);
m_remainingBytes -= rv;
DCHECK_GE(m_remainingBytes, 0);
- return true;
- } else {
- NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, ERR_FAILED));
+ return static_cast<int>(rv);
}
- return false;
+ return static_cast<int>(rv);
}
void URLRequestQrcJobQt::startGetHead()
diff --git a/src/core/url_request_qrc_job_qt.h b/src/core/url_request_qrc_job_qt.h
index cd8362574..5ad115da9 100644
--- a/src/core/url_request_qrc_job_qt.h
+++ b/src/core/url_request_qrc_job_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -52,7 +55,7 @@ public:
URLRequestQrcJobQt(net::URLRequest *request, net::NetworkDelegate *networkDelegate);
virtual void Start() Q_DECL_OVERRIDE;
virtual void Kill() Q_DECL_OVERRIDE;
- virtual bool ReadRawData(net::IOBuffer *buf, int bufSize, int *bytesRead) Q_DECL_OVERRIDE;
+ virtual int ReadRawData(net::IOBuffer* buf, int buf_size) Q_DECL_OVERRIDE;;
virtual bool GetMimeType(std::string *mimeType) const Q_DECL_OVERRIDE;
protected:
diff --git a/src/core/user_script_controller_host.cpp b/src/core/user_resource_controller_host.cpp
index 4dcd1a071..9d2ba8eb8 100644
--- a/src/core/user_script_controller_host.cpp
+++ b/src/core/user_resource_controller_host.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,30 +11,33 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "user_script_controller_host.h"
+#include "user_resource_controller_host.h"
#include "common/qt_messages.h"
#include "type_conversion.h"
@@ -49,9 +52,9 @@
namespace QtWebEngineCore {
-class UserScriptControllerHost::WebContentsObserverHelper : public content::WebContentsObserver {
+class UserResourceControllerHost::WebContentsObserverHelper : public content::WebContentsObserver {
public:
- WebContentsObserverHelper(UserScriptControllerHost *, content::WebContents *);
+ WebContentsObserverHelper(UserResourceControllerHost *, content::WebContents *);
// WebContentsObserver overrides:
void RenderViewCreated(content::RenderViewHost *renderViewHost) override;
@@ -59,23 +62,23 @@ public:
void WebContentsDestroyed() override;
private:
- UserScriptControllerHost *m_controllerHost;
+ UserResourceControllerHost *m_controllerHost;
};
-UserScriptControllerHost::WebContentsObserverHelper::WebContentsObserverHelper(UserScriptControllerHost *controller, content::WebContents *contents)
+UserResourceControllerHost::WebContentsObserverHelper::WebContentsObserverHelper(UserResourceControllerHost *controller, content::WebContents *contents)
: content::WebContentsObserver(contents)
, m_controllerHost(controller)
{
}
-void UserScriptControllerHost::WebContentsObserverHelper::RenderViewCreated(content::RenderViewHost *renderViewHost)
+void UserResourceControllerHost::WebContentsObserverHelper::RenderViewCreated(content::RenderViewHost *renderViewHost)
{
content::WebContents *contents = web_contents();
Q_FOREACH (const UserScript &script, m_controllerHost->m_perContentsScripts.value(contents))
renderViewHost->Send(new RenderViewObserverHelper_AddScript(renderViewHost->GetRoutingID(), script.data()));
}
-void UserScriptControllerHost::WebContentsObserverHelper::RenderViewHostChanged(content::RenderViewHost *oldHost,
+void UserResourceControllerHost::WebContentsObserverHelper::RenderViewHostChanged(content::RenderViewHost *oldHost,
content::RenderViewHost *newHost)
{
if (oldHost)
@@ -86,32 +89,32 @@ void UserScriptControllerHost::WebContentsObserverHelper::RenderViewHostChanged(
newHost->Send(new RenderViewObserverHelper_AddScript(newHost->GetRoutingID(), script.data()));
}
-void UserScriptControllerHost::WebContentsObserverHelper::WebContentsDestroyed()
+void UserResourceControllerHost::WebContentsObserverHelper::WebContentsDestroyed()
{
m_controllerHost->webContentsDestroyed(web_contents());
delete this;
}
-class UserScriptControllerHost::RenderProcessObserverHelper : public content::RenderProcessHostObserver {
+class UserResourceControllerHost::RenderProcessObserverHelper : public content::RenderProcessHostObserver {
public:
- RenderProcessObserverHelper(UserScriptControllerHost *);
+ RenderProcessObserverHelper(UserResourceControllerHost *);
virtual void RenderProcessHostDestroyed(content::RenderProcessHost *) Q_DECL_OVERRIDE;
private:
- UserScriptControllerHost *m_controllerHost;
+ UserResourceControllerHost *m_controllerHost;
};
-UserScriptControllerHost::RenderProcessObserverHelper::RenderProcessObserverHelper(UserScriptControllerHost *controller)
+UserResourceControllerHost::RenderProcessObserverHelper::RenderProcessObserverHelper(UserResourceControllerHost *controller)
: m_controllerHost(controller)
{
}
-void UserScriptControllerHost::RenderProcessObserverHelper::RenderProcessHostDestroyed(content::RenderProcessHost *renderer)
+void UserResourceControllerHost::RenderProcessObserverHelper::RenderProcessHostDestroyed(content::RenderProcessHost *renderer)
{
Q_ASSERT(m_controllerHost);
m_controllerHost->m_observedProcesses.remove(renderer);
}
-void UserScriptControllerHost::addUserScript(const UserScript &script, WebContentsAdapter *adapter)
+void UserResourceControllerHost::addUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
if (script.isNull())
return;
@@ -120,7 +123,7 @@ void UserScriptControllerHost::addUserScript(const UserScript &script, WebConten
if (!m_profileWideScripts.contains(script)) {
m_profileWideScripts.append(script);
Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses)
- renderer->Send(new UserScriptController_AddScript(script.data()));
+ renderer->Send(new UserResourceController_AddScript(script.data()));
}
} else {
content::WebContents *contents = adapter->webContents();
@@ -141,7 +144,7 @@ void UserScriptControllerHost::addUserScript(const UserScript &script, WebConten
}
}
-bool UserScriptControllerHost::containsUserScript(const UserScript &script, WebContentsAdapter *adapter)
+bool UserResourceControllerHost::containsUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
if (script.isNull())
return false;
@@ -151,7 +154,7 @@ bool UserScriptControllerHost::containsUserScript(const UserScript &script, WebC
return m_perContentsScripts.value(adapter->webContents()).contains(script);
}
-bool UserScriptControllerHost::removeUserScript(const UserScript &script, WebContentsAdapter *adapter)
+bool UserResourceControllerHost::removeUserScript(const UserScript &script, WebContentsAdapter *adapter)
{
if (script.isNull())
return false;
@@ -161,7 +164,7 @@ bool UserScriptControllerHost::removeUserScript(const UserScript &script, WebCon
if (it == m_profileWideScripts.end())
return false;
Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses)
- renderer->Send(new UserScriptController_RemoveScript((*it).data()));
+ renderer->Send(new UserResourceController_RemoveScript((*it).data()));
m_profileWideScripts.erase(it);
} else {
content::WebContents *contents = adapter->webContents();
@@ -177,12 +180,12 @@ bool UserScriptControllerHost::removeUserScript(const UserScript &script, WebCon
return true;
}
-void UserScriptControllerHost::clearAllScripts(WebContentsAdapter *adapter)
+void UserResourceControllerHost::clearAllScripts(WebContentsAdapter *adapter)
{
if (!adapter) {
m_profileWideScripts.clear();
Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses)
- renderer->Send(new UserScriptController_ClearScripts);
+ renderer->Send(new UserResourceController_ClearScripts);
} else {
content::WebContents *contents = adapter->webContents();
m_perContentsScripts.remove(contents);
@@ -190,14 +193,14 @@ void UserScriptControllerHost::clearAllScripts(WebContentsAdapter *adapter)
}
}
-const QList<UserScript> UserScriptControllerHost::registeredScripts(WebContentsAdapter *adapter) const
+const QList<UserScript> UserResourceControllerHost::registeredScripts(WebContentsAdapter *adapter) const
{
if (!adapter)
return m_profileWideScripts;
return m_perContentsScripts.value(adapter->webContents());
}
-void UserScriptControllerHost::reserve(WebContentsAdapter *adapter, int count)
+void UserResourceControllerHost::reserve(WebContentsAdapter *adapter, int count)
{
if (!adapter)
m_profileWideScripts.reserve(count);
@@ -205,7 +208,7 @@ void UserScriptControllerHost::reserve(WebContentsAdapter *adapter, int count)
m_perContentsScripts[adapter->webContents()].reserve(count);
}
-void UserScriptControllerHost::renderProcessStartedWithHost(content::RenderProcessHost *renderer)
+void UserResourceControllerHost::renderProcessStartedWithHost(content::RenderProcessHost *renderer)
{
if (m_observedProcesses.contains(renderer))
return;
@@ -215,19 +218,19 @@ void UserScriptControllerHost::renderProcessStartedWithHost(content::RenderProce
renderer->AddObserver(m_renderProcessObserver.data());
m_observedProcesses.insert(renderer);
Q_FOREACH (const UserScript &script, m_profileWideScripts)
- renderer->Send(new UserScriptController_AddScript(script.data()));
+ renderer->Send(new UserResourceController_AddScript(script.data()));
}
-void UserScriptControllerHost::webContentsDestroyed(content::WebContents *contents)
+void UserResourceControllerHost::webContentsDestroyed(content::WebContents *contents)
{
m_perContentsScripts.remove(contents);
}
-UserScriptControllerHost::UserScriptControllerHost()
+UserResourceControllerHost::UserResourceControllerHost()
{
}
-UserScriptControllerHost::~UserScriptControllerHost()
+UserResourceControllerHost::~UserResourceControllerHost()
{
Q_FOREACH (content::RenderProcessHost *renderer, m_observedProcesses)
renderer->RemoveObserver(m_renderProcessObserver.data());
diff --git a/src/core/user_script_controller_host.h b/src/core/user_resource_controller_host.h
index 3884fb3b9..8e6e1e3bf 100644
--- a/src/core/user_script_controller_host.h
+++ b/src/core/user_resource_controller_host.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,31 +11,34 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef USER_SCRIPT_CONTROLLER_HOST_H
-#define USER_SCRIPT_CONTROLLER_HOST_H
+#ifndef USER_RESOURCE_CONTROLLER_HOST_H
+#define USER_RESOURCE_CONTROLLER_HOST_H
#include "qtwebenginecoreglobal.h"
@@ -53,11 +56,11 @@ namespace QtWebEngineCore {
class WebContentsAdapter;
class WebContentsAdapterPrivate;
-class QWEBENGINE_EXPORT UserScriptControllerHost {
+class QWEBENGINE_EXPORT UserResourceControllerHost {
public:
- UserScriptControllerHost();
- ~UserScriptControllerHost();
+ UserResourceControllerHost();
+ ~UserResourceControllerHost();
void addUserScript(const UserScript &script, WebContentsAdapter *adapter);
bool containsUserScript(const UserScript &script, WebContentsAdapter *adapter);
@@ -69,7 +72,7 @@ public:
void renderProcessStartedWithHost(content::RenderProcessHost *renderer);
private:
- Q_DISABLE_COPY(UserScriptControllerHost)
+ Q_DISABLE_COPY(UserResourceControllerHost)
class WebContentsObserverHelper;
class RenderProcessObserverHelper;
@@ -84,4 +87,4 @@ private:
} // namespace
-#endif // USER_SCRIPT_CONTROLLER_HOST_H
+#endif // USER_RESOURCE_CONTROLLER_HOST_H
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp
index 179febc48..839eff366 100644
--- a/src/core/user_script.cpp
+++ b/src/core/user_script.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -36,7 +39,6 @@
#include "common/user_script_data.h"
#include "user_script.h"
-#include "user_script_controller_host.h"
#include "type_conversion.h"
namespace QtWebEngineCore {
diff --git a/src/core/user_script.h b/src/core/user_script.h
index 69c32c7ba..9d7d66a58 100644
--- a/src/core/user_script.h
+++ b/src/core/user_script.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -48,7 +51,7 @@ struct UserScriptData;
namespace QtWebEngineCore {
-class UserScriptControllerHost;
+class UserResourceControllerHost;
class QWEBENGINE_EXPORT UserScript : public QSharedData {
public:
@@ -85,7 +88,7 @@ public:
private:
void initData();
UserScriptData &data() const;
- friend class UserScriptControllerHost;
+ friend class UserResourceControllerHost;
QScopedPointer<UserScriptData> scriptData;
QString m_name;
diff --git a/src/core/web_channel_ipc_transport_host.cpp b/src/core/web_channel_ipc_transport_host.cpp
index ecc49ab5f..aef16f0a0 100644
--- a/src/core/web_channel_ipc_transport_host.cpp
+++ b/src/core/web_channel_ipc_transport_host.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -46,22 +49,40 @@
namespace QtWebEngineCore {
-WebChannelIPCTransportHost::WebChannelIPCTransportHost(content::WebContents *contents, QObject *parent)
+WebChannelIPCTransportHost::WebChannelIPCTransportHost(content::WebContents *contents, uint worldId, QObject *parent)
: QWebChannelAbstractTransport(parent)
, content::WebContentsObserver(contents)
+ , m_worldId(worldId)
{
+ Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId));
}
WebChannelIPCTransportHost::~WebChannelIPCTransportHost()
{
}
+void WebChannelIPCTransportHost::RenderViewHostChanged(content::RenderViewHost *, content::RenderViewHost *)
+{
+ // This means that we were moved into a different RenderView, possibly in a different
+ // render process and that we lost our WebChannelIPCTransport object and its state.
+ Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId));
+}
+
+void WebChannelIPCTransportHost::setWorldId(uint worldId)
+{
+ if (worldId == m_worldId)
+ return;
+ Send(new WebChannelIPCTransport_Uninstall(routing_id(), m_worldId));
+ m_worldId = worldId;
+ Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId));
+}
+
void WebChannelIPCTransportHost::sendMessage(const QJsonObject &message)
{
QJsonDocument doc(message);
int size = 0;
const char *rawData = doc.rawData(&size);
- Send(new WebChannelIPCTransport_Message(routing_id(), std::vector<char>(rawData, rawData + size)));
+ Send(new WebChannelIPCTransport_Message(routing_id(), std::vector<char>(rawData, rawData + size), m_worldId));
}
void WebChannelIPCTransportHost::onWebChannelMessage(const std::vector<char> &message)
diff --git a/src/core/web_channel_ipc_transport_host.h b/src/core/web_channel_ipc_transport_host.h
index 9c21116f1..9cc1f3104 100644
--- a/src/core/web_channel_ipc_transport_host.h
+++ b/src/core/web_channel_ipc_transport_host.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -52,15 +55,22 @@ class WebChannelIPCTransportHost : public QWebChannelAbstractTransport
, public content::WebContentsObserver
{
public:
- WebChannelIPCTransportHost(content::WebContents *, QObject *parent = 0);
+ WebChannelIPCTransportHost(content::WebContents *, uint worldId = 0, QObject *parent = 0);
virtual ~WebChannelIPCTransportHost();
+ // WebContentsObserver
+ virtual void RenderViewHostChanged(content::RenderViewHost* old_host, content::RenderViewHost* new_host) Q_DECL_OVERRIDE;
+
// QWebChannelAbstractTransport
virtual void sendMessage(const QJsonObject &message) Q_DECL_OVERRIDE;
+ void setWorldId(uint worldId);
+ uint worldId() const { return m_worldId; }
+
private:
bool OnMessageReceived(const IPC::Message& message) Q_DECL_OVERRIDE;
void onWebChannelMessage(const std::vector<char> &message);
+ uint m_worldId;
};
} // namespace
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index f447b5480..fc54c98ed 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -44,7 +47,9 @@
#include "browser_accessibility_qt.h"
#include "browser_context_adapter.h"
#include "browser_context_qt.h"
+#include "download_manager_delegate_qt.h"
#include "media_capture_devices_dispatcher.h"
+#include "print_view_manager_qt.h"
#include "qwebenginecallback_p.h"
#include "render_view_observer_host_qt.h"
#include "type_conversion.h"
@@ -54,6 +59,7 @@
#include "web_engine_context.h"
#include "web_engine_settings.h"
+#include <base/run_loop.h>
#include "base/values.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -64,20 +70,26 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/favicon_status.h"
+#include "content/public/common/content_constants.h"
+#include <content/public/common/drop_data.h>
#include "content/public/common/page_state.h"
#include "content/public/common/page_zoom.h"
#include "content/public/common/renderer_preferences.h"
#include "content/public/common/url_constants.h"
-#include "content/public/common/url_utils.h"
#include "content/public/common/web_preferences.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include <QDir>
#include <QGuiApplication>
+#include <QPageLayout>
#include <QStringList>
#include <QStyleHints>
+#include <QTimer>
#include <QVariant>
+#include <QtCore/qmimedata.h>
#include <QtGui/qaccessible.h>
+#include <QtGui/qdrag.h>
+#include <QtGui/qpixmap.h>
#include <QtWebChannel/QWebChannel>
namespace QtWebEngineCore {
@@ -165,7 +177,15 @@ static QVariant fromJSValue(const base::Value *result)
static void callbackOnEvaluateJS(WebContentsAdapterClient *adapterClient, quint64 requestId, const base::Value *result)
{
- adapterClient->didRunJavaScript(requestId, fromJSValue(result));
+ if (requestId)
+ adapterClient->didRunJavaScript(requestId, fromJSValue(result));
+}
+
+static void callbackOnPrintingFinished(WebContentsAdapterClient *adapterClient, int requestId, const std::vector<char>& result)
+{
+ if (requestId) {
+ adapterClient->didPrintPage(requestId, QByteArray(result.data(), result.size()));
+ }
}
static content::WebContents *createBlankWebContents(WebContentsAdapterClient *adapterClient, content::BrowserContext *browserContext)
@@ -211,7 +231,7 @@ static void serializeNavigationHistory(const content::NavigationController &cont
}
}
-static void deserializeNavigationHistory(QDataStream &input, int *currentIndex, ScopedVector<content::NavigationEntry> *entries, content::BrowserContext *browserContext)
+static void deserializeNavigationHistory(QDataStream &input, int *currentIndex, std::vector<scoped_ptr<content::NavigationEntry>> *entries, content::BrowserContext *browserContext)
{
int version;
input >> version;
@@ -252,8 +272,10 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
// If we couldn't unpack the entry successfully, abort everything.
if (input.status() != QDataStream::Ok) {
*currentIndex = -1;
- for (content::NavigationEntry *entry : *entries)
- delete entry;
+ auto it = entries->begin();
+ auto end = entries->end();
+ for (; it != end; ++it)
+ it->reset();
entries->clear();
return;
}
@@ -277,7 +299,7 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
entry->SetIsOverridingUserAgent(isOverridingUserAgent);
entry->SetTimestamp(base::Time::FromInternalValue(timestamp));
entry->SetHttpStatusCode(httpStatusCode);
- entries->push_back(entry.release());
+ entries->push_back(std::move(entry));
}
}
@@ -309,9 +331,14 @@ WebContentsAdapterPrivate::WebContentsAdapterPrivate()
// This has to be the first thing we create, and the last we destroy.
: engineContext(WebEngineContext::current())
, webChannel(0)
+ , webChannelWorld(0)
, adapterClient(0)
, nextRequestId(CallbackDirectory::ReservedCallbackIdsEnd)
, lastFindRequestId(0)
+ , currentDropData(nullptr)
+ , currentDropAction(Qt::IgnoreAction)
+ , inDragUpdateLoop(false)
+ , updateDragCursorMessagePollingTimer(new QTimer)
{
}
@@ -324,7 +351,7 @@ WebContentsAdapterPrivate::~WebContentsAdapterPrivate()
QSharedPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient)
{
int currentIndex;
- ScopedVector<content::NavigationEntry> entries;
+ std::vector<scoped_ptr<content::NavigationEntry>> entries;
deserializeNavigationHistory(input, &currentIndex, &entries, adapterClient->browserContextAdapter()->browserContext());
if (currentIndex == -1)
@@ -354,6 +381,7 @@ WebContentsAdapter::WebContentsAdapter(content::WebContents *webContents)
{
Q_D(WebContentsAdapter);
d->webContents.reset(webContents);
+ initUpdateDragCursorMessagePollingTimer();
}
WebContentsAdapter::~WebContentsAdapter()
@@ -395,6 +423,10 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient)
// This should only be necessary after having restored the history to a new WebContentsAdapter.
d->webContents->GetController().LoadIfNecessary();
+#if defined(ENABLE_BASIC_PRINTING)
+ PrintViewManagerQt::CreateForWebContents(webContents());
+#endif // defined(ENABLE_BASIC_PRINTING)
+
// Create an instance of WebEngineVisitedLinksManager to catch the first
// content::NOTIFICATION_RENDERER_PROCESS_CREATED event. This event will
// force to initialize visited links in VisitedLinkSlave.
@@ -405,7 +437,7 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient)
content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
Q_ASSERT(rvh);
if (!rvh->IsRenderViewLive())
- static_cast<content::WebContentsImpl*>(d->webContents.get())->CreateRenderViewForRenderManager(rvh, MSG_ROUTING_NONE, MSG_ROUTING_NONE, content::FrameReplicationState(), true);
+ static_cast<content::WebContentsImpl*>(d->webContents.get())->CreateRenderViewForRenderManager(rvh, MSG_ROUTING_NONE, MSG_ROUTING_NONE, content::FrameReplicationState());
}
void WebContentsAdapter::reattachRWHV()
@@ -487,7 +519,7 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
urlString.append(encodedData.constData(), encodedData.length());
GURL dataUrlToLoad(urlString);
- if (dataUrlToLoad.spec().size() > content::GetMaxURLChars()) {
+ if (dataUrlToLoad.spec().size() > content::kMaxURLChars) {
d->adapterClient->loadFinished(false, baseUrl, false, net::ERR_ABORTED);
return;
}
@@ -503,6 +535,12 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
d->webContents->Unselect();
}
+void WebContentsAdapter::save()
+{
+ Q_D(WebContentsAdapter);
+ d->webContents->OnSavePage();
+}
+
QUrl WebContentsAdapter::activeUrl() const
{
Q_D(const WebContentsAdapter);
@@ -545,7 +583,7 @@ QString WebContentsAdapter::pageTitle() const
QString WebContentsAdapter::selectedText() const
{
Q_D(const WebContentsAdapter);
- return toQt(d->webContents->GetRenderViewHost()->GetView()->GetSelectedText());
+ return toQt(d->webContents->GetRenderWidgetHostView()->GetSelectedText());
}
void WebContentsAdapter::undo()
@@ -596,6 +634,12 @@ void WebContentsAdapter::requestClose()
d->webContents->DispatchBeforeUnload(false);
}
+void WebContentsAdapter::unselect()
+{
+ Q_D(const WebContentsAdapter);
+ d->webContents->Unselect();
+}
+
void WebContentsAdapter::navigateToIndex(int offset)
{
Q_D(WebContentsAdapter);
@@ -720,21 +764,30 @@ QAccessibleInterface *WebContentsAdapter::browserAccessible()
}
#endif // QT_NO_ACCESSIBILITY
-void WebContentsAdapter::runJavaScript(const QString &javaScript)
+void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldId)
{
Q_D(WebContentsAdapter);
content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
Q_ASSERT(rvh);
- rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript));
+ if (worldId == 0) {
+ rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript));
+ return;
+ }
+
+ content::RenderFrameHost::JavaScriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, d->adapterClient, CallbackDirectory::NoCallbackId);
+ rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), callback, worldId);
}
-quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript)
+quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId)
{
Q_D(WebContentsAdapter);
content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
Q_ASSERT(rvh);
content::RenderFrameHost::JavaScriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, d->adapterClient, d->nextRequestId);
- rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), callback);
+ if (worldId == 0)
+ rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), callback);
+ else
+ rvh->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld(toString16(javaScript), callback, worldId);
return d->nextRequestId++;
}
@@ -804,7 +857,25 @@ void WebContentsAdapter::download(const QUrl &url, const QString &suggestedFileN
scoped_ptr<content::DownloadUrlParameters> params(
content::DownloadUrlParameters::FromWebContents(webContents(), toGurl(url)));
params->set_suggested_name(toString16(suggestedFileName));
- dlm->DownloadUrl(params.Pass());
+ dlm->DownloadUrl(std::move(params));
+}
+
+bool WebContentsAdapter::isAudioMuted() const
+{
+ const Q_D(WebContentsAdapter);
+ return d->webContents->IsAudioMuted();
+}
+
+void WebContentsAdapter::setAudioMuted(bool muted)
+{
+ Q_D(WebContentsAdapter);
+ d->webContents->SetAudioMuted(muted);
+}
+
+bool WebContentsAdapter::recentlyAudible()
+{
+ Q_D(WebContentsAdapter);
+ return d->webContents->WasRecentlyAudible();
}
void WebContentsAdapter::copyImageAt(const QPoint &location)
@@ -866,6 +937,41 @@ void WebContentsAdapter::wasHidden()
d->webContents->WasHidden();
}
+void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString &filePath)
+{
+#if defined(ENABLE_BASIC_PRINTING)
+ PrintViewManagerQt::FromWebContents(webContents())->PrintToPDF(pageLayout, filePath);
+#endif // if defined(ENABLE_BASIC_PRINTING)
+}
+
+quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayout)
+{
+#if defined(ENABLE_BASIC_PRINTING)
+ Q_D(WebContentsAdapter);
+ PrintViewManagerQt::PrintToPDFCallback callback = base::Bind(&callbackOnPrintingFinished, d->adapterClient, d->nextRequestId);
+ PrintViewManagerQt::FromWebContents(webContents())->PrintToPDFWithCallback(pageLayout, callback);
+ return d->nextRequestId++;
+#else
+ return 0;
+#endif // if defined(ENABLE_BASIC_PRINTING)
+}
+
+QPointF WebContentsAdapter::lastScrollOffset() const
+{
+ Q_D(const WebContentsAdapter);
+ if (content::RenderWidgetHostView *rwhv = d->webContents->GetRenderWidgetHostView())
+ return toQt(rwhv->GetLastScrollOffset());
+ return QPointF();
+}
+
+QSizeF WebContentsAdapter::lastContentsSize() const
+{
+ Q_D(const WebContentsAdapter);
+ if (RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt *>(d->webContents->GetRenderWidgetHostView()))
+ return toQt(rwhv->lastContentsSize());
+ return QSizeF();
+}
+
void WebContentsAdapter::grantMediaAccessPermission(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags flags)
{
Q_D(WebContentsAdapter);
@@ -902,7 +1008,7 @@ void WebContentsAdapter::dpiScaleChanged()
Q_D(WebContentsAdapter);
content::RenderWidgetHostImpl* impl = NULL;
if (d->webContents->GetRenderViewHost())
- impl = content::RenderWidgetHostImpl::From(d->webContents->GetRenderViewHost());
+ impl = content::RenderWidgetHostImpl::From(d->webContents->GetRenderViewHost()->GetWidget());
if (impl)
impl->NotifyScreenInfoChanged();
}
@@ -926,17 +1032,23 @@ QWebChannel *WebContentsAdapter::webChannel() const
return d->webChannel;
}
-void WebContentsAdapter::setWebChannel(QWebChannel *channel)
+void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId)
{
Q_D(WebContentsAdapter);
- if (d->webChannel == channel)
+ if (d->webChannel == channel && d->webChannelWorld == worldId)
return;
+
if (!d->webChannelTransport.get())
- d->webChannelTransport.reset(new WebChannelIPCTransportHost(d->webContents.get()));
- else
- d->webChannel->disconnectFrom(d->webChannelTransport.get());
+ d->webChannelTransport.reset(new WebChannelIPCTransportHost(d->webContents.get(), worldId));
+ else {
+ if (d->webChannel != channel)
+ d->webChannel->disconnectFrom(d->webChannelTransport.get());
+ if (d->webChannelWorld != worldId)
+ d->webChannelTransport->setWorldId(worldId);
+ }
d->webChannel = channel;
+ d->webChannelWorld = worldId;
if (!channel) {
d->webChannelTransport.reset();
return;
@@ -944,6 +1056,192 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel)
channel->connectTo(d->webChannelTransport.get());
}
+static QMimeData *mimeDataFromDropData(const content::DropData &dropData)
+{
+ QMimeData *mimeData = new QMimeData();
+ if (!dropData.text.is_null())
+ mimeData->setText(toQt(dropData.text.string()));
+ if (!dropData.html.is_null())
+ mimeData->setHtml(toQt(dropData.html.string()));
+ if (dropData.url.is_valid())
+ mimeData->setUrls(QList<QUrl>() << toQt(dropData.url));
+ return mimeData;
+}
+
+void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropData &dropData,
+ Qt::DropActions allowedActions, const QPixmap &pixmap,
+ const QPoint &offset)
+{
+ Q_D(WebContentsAdapter);
+
+ if (d->currentDropData)
+ return;
+
+ // Clear certain fields of the drop data to not run into DCHECKs
+ // of DropDataToWebDragData in render_view_impl.cc.
+ content::DropData fixedDropData = dropData;
+ fixedDropData.download_metadata.clear();
+ fixedDropData.file_contents.clear();
+ fixedDropData.file_description_filename.clear();
+
+ d->currentDropAction = Qt::IgnoreAction;
+ d->currentDropData = &fixedDropData;
+ QDrag *drag = new QDrag(dragSource); // will be deleted by Qt's DnD implementation
+ drag->setMimeData(mimeDataFromDropData(fixedDropData));
+ if (!pixmap.isNull()) {
+ drag->setPixmap(pixmap);
+ drag->setHotSpot(offset);
+ }
+
+ {
+ base::MessageLoop::ScopedNestableTaskAllower allow(base::MessageLoop::current());
+ drag->exec(allowedActions);
+ }
+
+ content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
+ rvh->DragSourceSystemDragEnded();
+ d->currentDropData = nullptr;
+}
+
+static blink::WebDragOperationsMask toWeb(const Qt::DropActions action)
+{
+ int result = blink::WebDragOperationNone;
+ if (action & Qt::CopyAction)
+ result |= blink::WebDragOperationCopy;
+ if (action & Qt::LinkAction)
+ result |= blink::WebDragOperationLink;
+ if (action & Qt::MoveAction)
+ result |= blink::WebDragOperationMove;
+ return static_cast<blink::WebDragOperationsMask>(result);
+}
+
+static void fillDropDataFromMimeData(content::DropData *dropData, const QMimeData *mimeData)
+{
+ Q_ASSERT(dropData->filenames.empty());
+ Q_FOREACH (const QUrl &url, mimeData->urls()) {
+ if (url.isLocalFile()) {
+ ui::FileInfo uifi;
+ uifi.path = toFilePath(url.toLocalFile());
+ dropData->filenames.push_back(uifi);
+ }
+ }
+ if (!dropData->filenames.empty())
+ return;
+ if (mimeData->hasHtml())
+ dropData->html = toNullableString16(mimeData->html());
+ else if (mimeData->hasText())
+ dropData->text = toNullableString16(mimeData->text());
+}
+
+void WebContentsAdapter::enterDrag(QDragEnterEvent *e, const QPoint &screenPos)
+{
+ Q_D(WebContentsAdapter);
+
+ scoped_ptr<content::DropData> ownedDropData;
+ const content::DropData *rvhDropData = d->currentDropData;
+ if (!rvhDropData) {
+ // The drag originated outside the WebEngineView.
+ ownedDropData.reset(new content::DropData);
+ fillDropDataFromMimeData(ownedDropData.get(), e->mimeData());
+ rvhDropData = ownedDropData.get();
+ }
+
+ content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
+ rvh->DragTargetDragEnter(*rvhDropData, toGfx(e->pos()), toGfx(screenPos),
+ toWeb(e->possibleActions()),
+ flagsFromModifiers(e->keyboardModifiers()));
+}
+
+Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const QPoint &screenPos)
+{
+ Q_D(WebContentsAdapter);
+ content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
+ rvh->DragTargetDragOver(toGfx(e->pos()), toGfx(screenPos), toWeb(e->possibleActions()),
+ blink::WebInputEvent::LeftButtonDown);
+
+ base::MessageLoop *currentMessageLoop = base::MessageLoop::current();
+ DCHECK(currentMessageLoop);
+ if (!currentMessageLoop->NestableTasksAllowed()) {
+ // We're already inside a MessageLoop::RunTask call, and scheduled tasks will not be
+ // executed. That means, updateDragAction will never be called, and the RunLoop below will
+ // remain blocked forever.
+ qWarning("WebContentsAdapter::updateDragPosition called from MessageLoop::RunTask.");
+ return Qt::IgnoreAction;
+ }
+
+ // Wait until we get notified via RenderViewHostDelegateView::UpdateDragCursor. This calls
+ // WebContentsAdapter::updateDragAction that will eventually quit the nested loop.
+ base::RunLoop loop;
+ d->inDragUpdateLoop = true;
+ d->dragUpdateLoopQuitClosure = loop.QuitClosure();
+
+ d->updateDragCursorMessagePollingTimer->start();
+ loop.Run();
+ d->updateDragCursorMessagePollingTimer->stop();
+
+ return d->currentDropAction;
+}
+
+void WebContentsAdapter::updateDragAction(Qt::DropAction action)
+{
+ Q_D(WebContentsAdapter);
+ d->currentDropAction = action;
+ finishDragUpdate();
+}
+
+void WebContentsAdapter::finishDragUpdate()
+{
+ Q_D(WebContentsAdapter);
+ if (d->inDragUpdateLoop) {
+ d->dragUpdateLoopQuitClosure.Run();
+ d->inDragUpdateLoop = false;
+ }
+}
+
+void WebContentsAdapter::endDragging(const QPoint &clientPos, const QPoint &screenPos)
+{
+ Q_D(WebContentsAdapter);
+ finishDragUpdate();
+ content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
+ rvh->DragTargetDrop(toGfx(clientPos), toGfx(screenPos), 0);
+}
+
+void WebContentsAdapter::leaveDrag()
+{
+ Q_D(WebContentsAdapter);
+ finishDragUpdate();
+ content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
+ rvh->DragTargetDragLeave();
+}
+
+void WebContentsAdapter::initUpdateDragCursorMessagePollingTimer()
+{
+ Q_D(WebContentsAdapter);
+ // Poll for drag cursor updated message 60 times per second. In practice, the timer is fired
+ // at most twice, after which it is stopped.
+ d->updateDragCursorMessagePollingTimer->setInterval(16);
+ d->updateDragCursorMessagePollingTimer->setSingleShot(false);
+
+ QObject::connect(d->updateDragCursorMessagePollingTimer.data(), &QTimer::timeout, [](){
+ base::MessagePump::Delegate *delegate = base::MessageLoop::current();
+ DCHECK(delegate);
+
+ // Execute Chromium tasks if there are any present. Specifically we are interested to handle
+ // the RenderViewHostImpl::OnUpdateDragCursor message, that gets sent from the render
+ // process.
+ while (delegate->DoWork()) {}
+ });
+}
+
+
+void WebContentsAdapter::replaceMisspelling(const QString &word)
+{
+#if defined(ENABLE_SPELLCHECK)
+ Q_D(WebContentsAdapter);
+ d->webContents->ReplaceMisspelling(toString16(word));
+#endif
+}
+
WebContentsAdapterClient::RenderProcessTerminationStatus
WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) {
auto status = WebContentsAdapterClient::RenderProcessTerminationStatus(-1);
@@ -976,4 +1274,10 @@ WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) {
return status;
}
+FaviconManager *WebContentsAdapter::faviconManager()
+{
+ Q_D(WebContentsAdapter);
+ return d->webContentsDelegate->faviconManager();
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index 0d9218d38..ec8cd7914 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -52,6 +55,10 @@ struct WebPreferences;
QT_BEGIN_NAMESPACE
class QAccessibleInterface;
+class QDragEnterEvent;
+class QDragMoveEvent;
+class QPageLayout;
+class QString;
class QWebChannel;
QT_END_NAMESPACE
@@ -60,6 +67,7 @@ namespace QtWebEngineCore {
class BrowserContextQt;
class MessagePassingInterface;
class WebContentsAdapterPrivate;
+class FaviconManager;
class QWEBENGINE_EXPORT WebContentsAdapter : public QEnableSharedFromThis<WebContentsAdapter> {
public:
@@ -77,6 +85,7 @@ public:
void reloadAndBypassCache();
void load(const QUrl&);
void setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl);
+ void save();
QUrl activeUrl() const;
QUrl requestedUrl() const;
QString pageTitle() const;
@@ -90,6 +99,7 @@ public:
void paste();
void pasteAndMatchStyle();
void selectAll();
+ void unselect();
void navigateToIndex(int);
void navigateToOffset(int);
@@ -104,14 +114,17 @@ public:
void serializeNavigationHistory(QDataStream &output);
void setZoomFactor(qreal);
qreal currentZoomFactor() const;
- void runJavaScript(const QString &javaScript);
- quint64 runJavaScriptCallbackResult(const QString &javaScript);
+ void runJavaScript(const QString &javaScript, quint32 worldId);
+ quint64 runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId);
quint64 fetchDocumentMarkup();
quint64 fetchDocumentInnerText();
quint64 findText(const QString &subString, bool caseSensitively, bool findBackward);
void stopFinding();
void updateWebPreferences(const content::WebPreferences &webPreferences);
void download(const QUrl &url, const QString &suggestedFileName);
+ bool isAudioMuted() const;
+ void setAudioMuted(bool mute);
+ bool recentlyAudible();
// Must match blink::WebMediaPlayerAction::Type.
enum MediaPlayerAction {
@@ -143,10 +156,27 @@ public:
BrowserContextQt* browserContext();
BrowserContextAdapter* browserContextAdapter();
QWebChannel *webChannel() const;
- void setWebChannel(QWebChannel *);
+ void setWebChannel(QWebChannel *, uint worldId);
+ FaviconManager *faviconManager();
+
+ QPointF lastScrollOffset() const;
+ QSizeF lastContentsSize() const;
+
+ void startDragging(QObject *dragSource, const content::DropData &dropData,
+ Qt::DropActions allowedActions, const QPixmap &pixmap, const QPoint &offset);
+ void enterDrag(QDragEnterEvent *e, const QPoint &screenPos);
+ Qt::DropAction updateDragPosition(QDragMoveEvent *e, const QPoint &screenPos);
+ void updateDragAction(Qt::DropAction action);
+ void finishDragUpdate();
+ void endDragging(const QPoint &clientPos, const QPoint &screenPos);
+ void leaveDrag();
+ void initUpdateDragCursorMessagePollingTimer();
+ void printToPDF(const QPageLayout&, const QString&);
+ quint64 printToPDFCallbackResult(const QPageLayout &);
// meant to be used within WebEngineCore only
content::WebContents *webContents() const;
+ void replaceMisspelling(const QString &word);
private:
Q_DISABLE_COPY(WebContentsAdapter)
diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h
index 449f382cf..3952067a7 100644
--- a/src/core/web_contents_adapter_client.h
+++ b/src/core/web_contents_adapter_client.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -50,10 +53,15 @@ QT_FORWARD_DECLARE_CLASS(QKeyEvent)
QT_FORWARD_DECLARE_CLASS(QVariant)
QT_FORWARD_DECLARE_CLASS(CertificateErrorController)
+namespace content {
+struct DropData;
+}
+
namespace QtWebEngineCore {
class AuthenticationDialogController;
class BrowserContextAdapter;
+class ColorChooserController;
class FilePickerController;
class JavaScriptDialogController;
class RenderWidgetHostViewQt;
@@ -71,6 +79,8 @@ public:
: mediaType(MediaTypeNone)
, hasImageContent(false)
, mediaFlags(0)
+ , isEditable(false)
+ , isSpellCheckerEnabled(false)
{
}
@@ -116,11 +126,12 @@ public:
bool hasImageContent;
uint mediaFlags;
QString suggestedFileName;
+ bool isEditable;
+ bool isSpellCheckerEnabled;
+ QString misspelledWord;
+ QStringList spellCheckerSuggestions;
// Some likely candidates for future additions as we add support for the related actions:
// bool isImageBlocked;
-// bool isEditable;
-// bool isSpellCheckingEnabled;
-// QStringList spellCheckingSuggestions;
// <enum tbd> mediaType;
// ...
};
@@ -197,6 +208,7 @@ public:
virtual void loadProgressChanged(int progress) = 0;
virtual void didUpdateTargetURL(const QUrl&) = 0;
virtual void selectionChanged() = 0;
+ virtual void recentlyAudibleChanged(bool recentlyAudible) = 0;
virtual QRectF viewportRect() const = 0;
virtual qreal dpiScale() const = 0;
virtual QColor backgroundColor() const = 0;
@@ -210,16 +222,18 @@ public:
virtual bool isBeingAdopted() = 0;
virtual void close() = 0;
virtual void windowCloseRejected() = 0;
- virtual bool contextMenuRequested(const WebEngineContextMenuData&) = 0;
+ virtual bool contextMenuRequested(const WebEngineContextMenuData &) = 0;
virtual void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) = 0;
virtual void requestFullScreenMode(const QUrl &origin, bool fullscreen) = 0;
virtual bool isFullScreenMode() const = 0;
virtual void javascriptDialog(QSharedPointer<JavaScriptDialogController>) = 0;
virtual void runFileChooser(FilePickerController *controller) = 0;
+ virtual void showColorDialog(QSharedPointer<ColorChooserController>) = 0;
virtual void didRunJavaScript(quint64 requestId, const QVariant& result) = 0;
virtual void didFetchDocumentMarkup(quint64 requestId, const QString& result) = 0;
virtual void didFetchDocumentInnerText(quint64 requestId, const QString& result) = 0;
virtual void didFindText(quint64 requestId, int matchCount) = 0;
+ virtual void didPrintPage(quint64 requestId, const QByteArray &result) = 0;
virtual void passOnFocus(bool reverse) = 0;
// returns the last QObject (QWidget/QQuickItem) based object in the accessibility
// hierarchy before going into the BrowserAccessibility tree
@@ -239,10 +253,15 @@ public:
virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) = 0;
virtual void requestGeometryChange(const QRect &geometry) = 0;
virtual void allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController) = 0;
+ virtual void updateScrollPosition(const QPointF &position) = 0;
+ virtual void updateContentsSize(const QSizeF &size) = 0;
+ virtual void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
+ const QPixmap &pixmap, const QPoint &offset) = 0;
virtual bool isEnabled() const = 0;
virtual const QObject *holdingQObject() const = 0;
virtual QSharedPointer<BrowserContextAdapter> browserContextAdapter() = 0;
+ virtual WebContentsAdapter* webContentsAdapter() = 0;
};
diff --git a/src/core/web_contents_adapter_p.h b/src/core/web_contents_adapter_p.h
index 89a18fb02..5c0e83298 100644
--- a/src/core/web_contents_adapter_p.h
+++ b/src/core/web_contents_adapter_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -50,23 +53,30 @@
#include "web_contents_adapter.h"
+#include <base/callback.h>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include <QScopedPointer>
#include <QSharedPointer>
+QT_FORWARD_DECLARE_CLASS(QTimer)
QT_FORWARD_DECLARE_CLASS(QWebChannel)
class WebEngineContext;
+namespace content {
+struct DropData;
+}
+
namespace QtWebEngineCore {
class BrowserContextAdapter;
class RenderViewObserverHostQt;
-class UserScriptControllerHost;
class WebChannelIPCTransportHost;
class WebContentsAdapterClient;
class WebContentsDelegateQt;
+class WebEngineContext;
class WebContentsAdapterPrivate {
public:
@@ -79,9 +89,15 @@ public:
scoped_ptr<RenderViewObserverHostQt> renderViewObserverHost;
scoped_ptr<WebChannelIPCTransportHost> webChannelTransport;
QWebChannel *webChannel;
+ unsigned int webChannelWorld;
WebContentsAdapterClient *adapterClient;
quint64 nextRequestId;
int lastFindRequestId;
+ const content::DropData *currentDropData;
+ Qt::DropAction currentDropAction;
+ bool inDragUpdateLoop;
+ base::Closure dragUpdateLoopQuitClosure;
+ QScopedPointer<QTimer> updateDragCursorMessagePollingTimer;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 5e9157069..757ae853c 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -41,6 +44,10 @@
#include "web_contents_delegate_qt.h"
#include "browser_context_adapter.h"
+#include "color_chooser_qt.h"
+#include "color_chooser_controller.h"
+#include "favicon_manager.h"
+#include "favicon_manager_p.h"
#include "file_picker_controller.h"
#include "media_capture_devices_dispatcher.h"
#include "network_delegate_qt.h"
@@ -53,7 +60,6 @@
#include "components/web_cache/browser/web_cache_manager.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
-#include "content/public/browser/favicon_status.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
@@ -68,11 +74,12 @@
#include "ui/events/latency_info.h"
#include <QDesktopServices>
+#include <QTimer>
namespace QtWebEngineCore {
// Maps the LogSeverity defines in base/logging.h to the web engines message levels.
-static WebContentsAdapterClient::JavaScriptConsoleMessageLevel mapToJavascriptConsoleMessageLevel(int32 messageLevel) {
+static WebContentsAdapterClient::JavaScriptConsoleMessageLevel mapToJavascriptConsoleMessageLevel(int32_t messageLevel) {
if (messageLevel < 1)
return WebContentsAdapterClient::Info;
else if (messageLevel > 1)
@@ -84,6 +91,7 @@ static WebContentsAdapterClient::JavaScriptConsoleMessageLevel mapToJavascriptCo
WebContentsDelegateQt::WebContentsDelegateQt(content::WebContents *webContents, WebContentsAdapterClient *adapterClient)
: m_viewClient(adapterClient)
, m_lastReceivedFindReply(0)
+ , m_faviconManager(new FaviconManager(new FaviconManagerPrivate(webContents, adapterClient)))
{
webContents->SetDelegate(this);
Observe(webContents);
@@ -100,16 +108,19 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents
Q_ASSERT(target);
content::NavigationController::LoadURLParams load_url_params(params.url);
+ load_url_params.source_site_instance = params.source_site_instance;
load_url_params.referrer = params.referrer;
load_url_params.frame_tree_node_id = params.frame_tree_node_id;
+ load_url_params.redirect_chain = params.redirect_chain;
load_url_params.transition_type = params.transition;
load_url_params.extra_headers = params.extra_headers;
load_url_params.should_replace_current_entry = params.should_replace_current_entry;
load_url_params.is_renderer_initiated = params.is_renderer_initiated;
load_url_params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
-
- if (params.transferred_global_request_id != content::GlobalRequestID())
- load_url_params.transferred_global_request_id = params.transferred_global_request_id;
+ if (params.uses_post) {
+ load_url_params.load_type = content::NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST;
+ load_url_params.browser_initiated_post_data = params.browser_initiated_post_data;
+ }
target->GetController().LoadURLWithParams(load_url_params);
return target;
@@ -121,6 +132,15 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source,
m_viewClient->urlChanged(toQt(source->GetVisibleURL()));
if (changed_flags & content::INVALIDATE_TYPE_TITLE)
m_viewClient->titleChanged(toQt(source->GetTitle()));
+
+ // NavigationStateChanged gets called with INVALIDATE_TYPE_TAB by AudioStateProvider::Notify,
+ // whenever an audio sound gets played or stopped, this is the only way to actually figure out
+ // if there was a recently played audio sound.
+ // Make sure to only emit the signal when loading isn't in progress, because it causes multiple
+ // false signals to be emitted.
+ if ((changed_flags & content::INVALIDATE_TYPE_TAB) && !(changed_flags & content::INVALIDATE_TYPE_LOAD)) {
+ m_viewClient->recentlyAudibleChanged(source->WasRecentlyAudible());
+ }
}
bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *source)
@@ -176,8 +196,10 @@ void WebContentsDelegateQt::DidStartProvisionalLoadForFrame(content::RenderFrame
m_loadingErrorFrameList.append(render_frame_host->GetRoutingID());
// Trigger LoadStarted signal for main frame's error page only.
- if (!render_frame_host->GetParent())
+ if (!render_frame_host->GetParent()) {
+ m_faviconManager->resetCandidates();
m_viewClient->loadStarted(toQt(validated_url), true);
+ }
return;
}
@@ -186,6 +208,7 @@ void WebContentsDelegateQt::DidStartProvisionalLoadForFrame(content::RenderFrame
return;
m_loadingErrorFrameList.clear();
+ m_faviconManager->resetCandidates();
m_viewClient->loadStarted(toQt(validated_url));
}
@@ -217,6 +240,7 @@ void WebContentsDelegateQt::DidFailLoad(content::RenderFrameHost* render_frame_h
if (render_frame_host->GetParent())
return;
+ m_viewClient->iconChanged(QUrl());
m_viewClient->loadFinished(false /* success */ , toQt(validated_url), false /* isErrorPage */, error_code, toQt(error_description));
m_viewClient->loadProgressChanged(0);
}
@@ -238,33 +262,33 @@ void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame
if (render_frame_host->GetParent())
return;
- m_viewClient->loadFinished(true, toQt(validated_url));
-
- content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
- if (!entry)
- return;
- content::FaviconStatus &favicon = entry->GetFavicon();
- if (favicon.valid)
- m_viewClient->iconChanged(toQt(favicon.url));
- else
+ if (!m_faviconManager->hasCandidate())
m_viewClient->iconChanged(QUrl());
+
+ m_viewClient->loadProgressChanged(100);
+ m_viewClient->loadFinished(true, toQt(validated_url));
}
-void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL>& candidates)
+void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates)
{
- Q_FOREACH (content::FaviconURL candidate, candidates) {
- if (candidate.icon_type == content::FaviconURL::FAVICON && !candidate.icon_url.is_empty()) {
- content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
- if (!entry)
- continue;
- content::FaviconStatus &favicon = entry->GetFavicon();
- favicon.url = candidate.icon_url;
- favicon.valid = toQt(candidate.icon_url).isValid();
- break;
- }
+ QList<FaviconInfo> faviconCandidates;
+ faviconCandidates.reserve(static_cast<int>(candidates.size()));
+ for (const content::FaviconURL &candidate : candidates) {
+ // Store invalid candidates too for later debugging via API
+ faviconCandidates.append(toFaviconInfo(candidate));
}
+
+ m_faviconManager->update(faviconCandidates);
}
+content::ColorChooser *WebContentsDelegateQt::OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<content::ColorSuggestion> &suggestion)
+{
+ Q_UNUSED(suggestion);
+ ColorChooserQt *colorChooser = new ColorChooserQt(source, toQt(color));
+ m_viewClient->showColorDialog(colorChooser->controller());
+
+ return colorChooser;
+}
content::JavaScriptDialogManager *WebContentsDelegateQt::GetJavaScriptDialogManager(content::WebContents *)
{
return JavaScriptDialogManagerQt::GetInstance();
@@ -302,10 +326,14 @@ void WebContentsDelegateQt::RunFileChooser(content::WebContents *web_contents, c
acceptedMimeTypes.append(toQt(*it));
FilePickerController *controller = new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode), web_contents, toQt(params.default_file_name.value()), acceptedMimeTypes);
- m_viewClient->runFileChooser(controller);
+
+ // Defer the call to not block base::MessageLoop::RunTask with modal dialogs.
+ QTimer::singleShot(0, [this, controller] () {
+ m_viewClient->runFileChooser(controller);
+ });
}
-bool WebContentsDelegateQt::AddMessageToConsole(content::WebContents *source, int32 level, const base::string16 &message, int32 line_no, const base::string16 &source_id)
+bool WebContentsDelegateQt::AddMessageToConsole(content::WebContents *source, int32_t level, const base::string16 &message, int32_t line_no, const base::string16 &source_id)
{
Q_UNUSED(source)
m_viewClient->javaScriptConsoleMessage(mapToJavascriptConsoleMessageLevel(level), toQt(message), static_cast<int>(line_no), toQt(source_id));
@@ -446,4 +474,9 @@ bool WebContentsDelegateQt::CheckMediaAccessPermission(content::WebContents *web
}
}
+FaviconManager *WebContentsDelegateQt::faviconManager()
+{
+ return m_faviconManager.data();
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 9aace06dd..d523aa16b 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -40,9 +43,12 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/permission_status.mojom.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "base/callback.h"
+#include "color_chooser_controller.h"
+#include "favicon_manager.h"
#include "javascript_dialog_manager_qt.h"
#include <QtCore/qvector.h>
#include <QtCore/qcompilerdetection.h>
@@ -51,11 +57,13 @@ QT_FORWARD_DECLARE_CLASS(CertificateErrorController)
namespace content {
class BrowserContext;
+ class ColorChooser;
class SiteInstance;
class RenderViewHost;
class JavaScriptDialogManager;
class WebContents;
struct WebPreferences;
+ struct ColorSuggestion;
}
namespace QtWebEngineCore {
@@ -79,12 +87,13 @@ public:
virtual void CloseContents(content::WebContents *source) Q_DECL_OVERRIDE;
virtual void LoadProgressChanged(content::WebContents* source, double progress) Q_DECL_OVERRIDE;
virtual void HandleKeyboardEvent(content::WebContents *source, const content::NativeWebKeyboardEvent &event) Q_DECL_OVERRIDE;
+ virtual content::ColorChooser *OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<content::ColorSuggestion> &suggestion) Q_DECL_OVERRIDE;
virtual content::JavaScriptDialogManager *GetJavaScriptDialogManager(content::WebContents *source) Q_DECL_OVERRIDE;
virtual void EnterFullscreenModeForTab(content::WebContents* web_contents, const GURL& origin) Q_DECL_OVERRIDE;
virtual void ExitFullscreenModeForTab(content::WebContents*) Q_DECL_OVERRIDE;
virtual bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) const Q_DECL_OVERRIDE;
virtual void RunFileChooser(content::WebContents *, const content::FileChooserParams &params) Q_DECL_OVERRIDE;
- virtual bool AddMessageToConsole(content::WebContents* source, int32 level, const base::string16& message, int32 line_no, const base::string16& source_id) Q_DECL_OVERRIDE;
+ virtual bool AddMessageToConsole(content::WebContents* source, int32_t level, const base::string16& message, int32_t line_no, const base::string16& source_id) Q_DECL_OVERRIDE;
virtual void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) Q_DECL_OVERRIDE;
virtual void RequestMediaAccessPermission(content::WebContents* web_contents, const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) Q_DECL_OVERRIDE;
virtual void MoveContents(content::WebContents *source, const gfx::Rect &pos) Q_DECL_OVERRIDE;
@@ -115,6 +124,7 @@ public:
void allowCertificateError(const QSharedPointer<CertificateErrorController> &) ;
void requestGeolocationPermission(const QUrl &requestingOrigin);
void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame);
+ FaviconManager *faviconManager();
private:
QWeakPointer<WebContentsAdapter> createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture);
@@ -122,7 +132,8 @@ private:
WebContentsAdapterClient *m_viewClient;
QString m_lastSearchedString;
int m_lastReceivedFindReply;
- QVector<int64> m_loadingErrorFrameList;
+ QVector<int64_t> m_loadingErrorFrameList;
+ QScopedPointer<FaviconManager> m_faviconManager;
};
} // namespace QtWebEngineCore
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index ae53619ac..e487fca46 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -36,14 +39,18 @@
#include "web_contents_view_qt.h"
-#include "browser_context_qt.h"
+#include "browser_context_adapter.h"
#include "content_browser_client_qt.h"
#include "render_widget_host_view_qt_delegate.h"
#include "type_conversion.h"
+#include "web_contents_adapter.h"
#include "web_engine_context.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/public/common/context_menu_params.h"
+#include <ui/gfx/image/image_skia.h>
+
+#include <QtGui/qpixmap.h>
namespace QtWebEngineCore {
@@ -89,7 +96,7 @@ void WebContentsViewQt::RenderViewCreated(content::RenderViewHost* host)
// The render process is done creating the RenderView and it's ready to be routed
// messages at this point.
if (m_client)
- host->GetView()->SetBackgroundColor(toSk(m_client->backgroundColor()));
+ m_webContents->GetRenderWidgetHostView()->SetBackgroundColor(toSk(m_client->backgroundColor()));
}
void WebContentsViewQt::CreateView(const gfx::Size& initial_size, gfx::NativeView context)
@@ -145,7 +152,7 @@ ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaControls, blink::WebContextMen
ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanPrint, blink::WebContextMenuData::MediaCanPrint)
ASSERT_ENUMS_MATCH(WebEngineContextMenuData::MediaCanRotate, blink::WebContextMenuData::MediaCanRotate)
-static WebEngineContextMenuData fromParams(const content::ContextMenuParams &params)
+static inline WebEngineContextMenuData fromParams(const content::ContextMenuParams &params)
{
WebEngineContextMenuData ret;
ret.pos = QPoint(params.x, params.y);
@@ -157,24 +164,75 @@ static WebEngineContextMenuData fromParams(const content::ContextMenuParams &par
ret.hasImageContent = params.has_image_contents;
ret.mediaFlags = params.media_flags;
ret.suggestedFileName = toQt(params.suggested_filename.data());
+ ret.isEditable = params.is_editable;
+#if defined(ENABLE_SPELLCHECK)
+ ret.misspelledWord = toQt(params.misspelled_word);
+ ret.spellCheckerSuggestions = fromVector(params.dictionary_suggestions);
+#endif
return ret;
}
void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params)
{
WebEngineContextMenuData contextMenuData(fromParams(params));
+#if defined(ENABLE_SPELLCHECK)
+ // Do not use params.spellcheck_enabled, since it is never
+ // correctly initialized for chrome asynchronous spellchecking.
+ // Even fixing the initialization in ContextMenuClientImpl::showContextMenu
+ // will not work. By default SpellCheck::spellcheck_enabled_
+ // must be initialized to true due to the way how the initialization sequence
+ // in SpellCheck works ie. typing the first word triggers the creation
+ // of the SpellcheckService. Use user preference store instead.
+ contextMenuData.isSpellCheckerEnabled = m_client->browserContextAdapter()->isSpellCheckEnabled();
+#endif
m_client->contextMenuRequested(contextMenuData);
}
-void WebContentsViewQt::StartDragging(const content::DropData& drop_data, blink::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info)
+Qt::DropActions toQtDropActions(blink::WebDragOperationsMask ops)
+{
+ Qt::DropActions result;
+ if (ops & blink::WebDragOperationCopy)
+ result |= Qt::CopyAction;
+ if (ops & blink::WebDragOperationLink)
+ result |= Qt::LinkAction;
+ if (ops & blink::WebDragOperationMove || ops & blink::WebDragOperationDelete)
+ result |= Qt::MoveAction;
+ return result;
+}
+
+Qt::DropAction toQt(blink::WebDragOperation op)
+{
+ if (op == blink::WebDragOperationCopy)
+ return Qt::CopyAction;
+ if (op == blink::WebDragOperationLink)
+ return Qt::LinkAction;
+ if (op == blink::WebDragOperationMove || op == blink::WebDragOperationDelete)
+ return Qt::MoveAction;
+ return Qt::IgnoreAction;
+}
+
+void WebContentsViewQt::StartDragging(const content::DropData &drop_data,
+ blink::WebDragOperationsMask allowed_ops,
+ const gfx::ImageSkia &image,
+ const gfx::Vector2d &image_offset,
+ const content::DragEventSourceInfo &event_info)
+{
+ Q_UNUSED(event_info);
+
+ QPixmap pixmap;
+ QPoint hotspot;
+ pixmap = QPixmap::fromImage(toQImage(image.GetRepresentation(m_client->dpiScale())));
+ if (!pixmap.isNull()) {
+ hotspot.setX(image_offset.x());
+ hotspot.setY(image_offset.y());
+ }
+
+ m_client->startDragging(drop_data, toQtDropActions(allowed_ops), pixmap, hotspot);
+}
+
+void WebContentsViewQt::UpdateDragCursor(blink::WebDragOperation dragOperation)
{
- Q_UNUSED(&drop_data);
- Q_UNUSED(allowed_ops);
- Q_UNUSED(&image);
- Q_UNUSED(&image_offset);
- Q_UNUSED(&event_info);
- // Tell the renderer to cancel the drag, see StartDragging's declaration in render_view_host_delegate_view.h for info.
- m_webContents->SystemDragEnded();
+ m_client->webContentsAdapter()->updateDragAction(toQt(dragOperation));
}
void WebContentsViewQt::TakeFocus(bool reverse)
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index cbbca2371..48532c0c5 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -104,7 +107,11 @@ public:
virtual gfx::Rect GetViewBounds() const Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED return gfx::Rect(); }
- virtual void StartDragging(const content::DropData& drop_data, blink::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info) Q_DECL_OVERRIDE;
+ void StartDragging(const content::DropData &drop_data, blink::WebDragOperationsMask allowed_ops,
+ const gfx::ImageSkia &image, const gfx::Vector2d &image_offset,
+ const content::DragEventSourceInfo &event_info) Q_DECL_OVERRIDE;
+
+ void UpdateDragCursor(blink::WebDragOperation dragOperation) Q_DECL_OVERRIDE;
virtual void ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params) Q_DECL_OVERRIDE;
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 629490440..0d1d7b127 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -45,6 +48,9 @@
#include "base/run_loop.h"
#include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h"
+#if defined(ENABLE_BASIC_PRINTING)
+#include "chrome/browser/printing/print_job_manager.h"
+#endif // defined(ENABLE_BASIC_PRINTING)
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/utility_process_host_impl.h"
@@ -52,6 +58,8 @@
#include "content/public/app/content_main.h"
#include "content/public/app/content_main_runner.h"
#include "content/public/browser/browser_main_runner.h"
+#include "content/public/browser/plugin_service.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
@@ -63,7 +71,7 @@
#include "ui/gl/gl_switches.h"
#if defined(OS_WIN)
#include "sandbox/win/src/sandbox_types.h"
-#include "content/public/app/startup_helper_win.h"
+#include "content/public/app/sandbox_helper_win.h"
#endif // OS_WIN
#include "browser_context_adapter.h"
@@ -93,7 +101,8 @@ QT_END_NAMESPACE
namespace {
-scoped_refptr<WebEngineContext> sContext;
+scoped_refptr<QtWebEngineCore::WebEngineContext> sContext;
+static bool s_destroyed = false;
void destroyContext()
{
@@ -102,6 +111,7 @@ void destroyContext()
// WebEngineContext's pointer is used.
sContext->destroy();
sContext = 0;
+ s_destroyed = true;
}
bool usingANGLE()
@@ -146,8 +156,16 @@ bool usingQtQuick2DRenderer()
return device == QLatin1String("softwarecontext");
}
+#if defined(ENABLE_PLUGINS)
+void dummyGetPluginCallback(const std::vector<content::WebPluginInfo>&)
+{
+}
+#endif
+
} // namespace
+namespace QtWebEngineCore {
+
void WebEngineContext::destroyBrowserContext()
{
m_defaultBrowserContext.reset();
@@ -168,18 +186,29 @@ void WebEngineContext::destroy()
// RenderProcessHostImpl should be destroyed before WebEngineContext since
// default BrowserContext might be used by the RenderprocessHostImpl's destructor.
m_browserRunner.reset(0);
+
+ // Drop the false reference.
+ sContext->Release();
}
WebEngineContext::~WebEngineContext()
{
+ // WebEngineContext::destroy() must be called before we are deleted
+ Q_ASSERT(!m_globalQObject);
+ Q_ASSERT(!m_devtools);
+ Q_ASSERT(!m_browserRunner);
}
scoped_refptr<WebEngineContext> WebEngineContext::current()
{
+ if (s_destroyed)
+ return nullptr;
if (!sContext.get()) {
sContext = new WebEngineContext();
// Make sure that we ramp down Chromium before QApplication destroys its X connection, etc.
qAddPostRoutine(destroyContext);
+ // Add a false reference so there is no race between unreferencing sContext and a global QApplication.
+ sContext->AddRef();
}
return sContext;
}
@@ -219,6 +248,9 @@ WebEngineContext::WebEngineContext()
qputenv("force_s3tc_enable", "true");
#endif
+ // Allow us to inject javascript like any webview toolkit.
+ content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView();
+
#if defined(Q_OS_WIN)
// We must initialize the command line with the UTF-16 arguments vector we got from
// QCoreApplication. CommandLine::Init ignores its arguments on Windows and calls
@@ -242,17 +274,33 @@ WebEngineContext::WebEngineContext()
#endif
parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
- parsedCommandLine->AppendSwitch(switches::kNoSandbox);
- parsedCommandLine->AppendSwitch(switches::kEnableDelegatedRenderer);
+
+ // Enable sandboxing on OS X and Linux (Desktop / Embedded) by default.
+ bool disable_sandbox = qEnvironmentVariableIsSet("QTWEBENGINE_DISABLE_SANDBOX");
+ if (!disable_sandbox) {
+#if defined(Q_OS_WIN)
+ parsedCommandLine->AppendSwitch(switches::kNoSandbox);
+#elif defined(Q_OS_LINUX)
+ parsedCommandLine->AppendSwitch(switches::kDisableSetuidSandbox);
+#endif
+ } else {
+ parsedCommandLine->AppendSwitch(switches::kNoSandbox);
+ qInfo() << "Sandboxing disabled by user.";
+ }
+
parsedCommandLine->AppendSwitch(switches::kEnableThreadedCompositing);
parsedCommandLine->AppendSwitch(switches::kInProcessGPU);
+ // These are currently only default on OS X, and we don't support them:
+ parsedCommandLine->AppendSwitch(switches::kDisableZeroCopy);
+ parsedCommandLine->AppendSwitch(switches::kDisableGpuMemoryBufferCompositorResources);
if (useEmbeddedSwitches) {
// Inspired by the Android port's default switches
- parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar);
- parsedCommandLine->AppendSwitch(switches::kEnablePinch);
+ if (!parsedCommandLine->HasSwitch(switches::kDisableOverlayScrollbar))
+ parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar);
+ if (!parsedCommandLine->HasSwitch(switches::kDisablePinch))
+ parsedCommandLine->AppendSwitch(switches::kEnablePinch);
parsedCommandLine->AppendSwitch(switches::kEnableViewport);
- parsedCommandLine->AppendSwitch(switches::kEnableViewportMeta);
parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges);
parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
parsedCommandLine->AppendSwitch(switches::kDisableGpuShaderDiskCache);
@@ -331,4 +379,26 @@ WebEngineContext::WebEngineContext()
// thread to avoid a thread check assertion in its constructor when it
// first gets referenced on the IO thread.
MediaCaptureDevicesDispatcher::GetInstance();
+
+#if defined(ENABLE_PLUGINS)
+ // Creating pepper plugins from the page (which calls PluginService::GetPluginInfoArray)
+ // might fail unless the page queried the list of available plugins at least once
+ // (which ends up calling PluginService::GetPlugins). Since the plugins list can only
+ // be created from the FILE thread, and that GetPluginInfoArray is synchronous, it
+ // can't loads plugins synchronously from the IO thread to serve the render process' request
+ // and we need to make sure that it happened beforehand.
+ content::PluginService::GetInstance()->GetPlugins(base::Bind(&dummyGetPluginCallback));
+#endif
+
+#if defined(ENABLE_BASIC_PRINTING)
+ m_printJobManager.reset(new printing::PrintJobManager());
+#endif // defined(ENABLE_BASIC_PRINTING)
}
+
+#if defined(ENABLE_BASIC_PRINTING)
+printing::PrintJobManager* WebEngineContext::getPrintJobManager()
+{
+ return m_printJobManager.get();
+}
+#endif // defined(ENABLE_BASIC_PRINTING)
+} // namespace
diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h
index f9fae89f6..960f8ed47 100644
--- a/src/core/web_engine_context.h
+++ b/src/core/web_engine_context.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -55,6 +58,12 @@ class BrowserMainRunner;
class ContentMainRunner;
}
+#if defined(ENABLE_BASIC_PRINTING)
+namespace printing {
+class PrintJobManager;
+}
+#endif // defined(ENABLE_BASIC_PRINTING)
+
QT_FORWARD_DECLARE_CLASS(QObject)
namespace QtWebEngineCore {
@@ -62,7 +71,6 @@ namespace QtWebEngineCore {
class BrowserContextAdapter;
class ContentMainDelegateQt;
class SurfaceFactoryQt;
-} // namespace
class WebEngineContext : public base::RefCounted<WebEngineContext> {
public:
@@ -70,7 +78,9 @@ public:
QSharedPointer<QtWebEngineCore::BrowserContextAdapter> defaultBrowserContext();
QObject *globalQObject();
-
+#if defined(ENABLE_BASIC_PRINTING)
+ printing::PrintJobManager* getPrintJobManager();
+#endif // defined(ENABLE_BASIC_PRINTING)
void destroyBrowserContext();
void destroy();
@@ -80,12 +90,17 @@ private:
~WebEngineContext();
scoped_ptr<base::RunLoop> m_runLoop;
- scoped_ptr<QtWebEngineCore::ContentMainDelegateQt> m_mainDelegate;
+ scoped_ptr<ContentMainDelegateQt> m_mainDelegate;
scoped_ptr<content::ContentMainRunner> m_contentRunner;
scoped_ptr<content::BrowserMainRunner> m_browserRunner;
QObject* m_globalQObject;
QSharedPointer<QtWebEngineCore::BrowserContextAdapter> m_defaultBrowserContext;
scoped_ptr<devtools_http_handler::DevToolsHttpHandler> m_devtools;
+#if defined(ENABLE_BASIC_PRINTING)
+ scoped_ptr<printing::PrintJobManager> m_printJobManager;
+#endif // defined(ENABLE_BASIC_PRINTING)
};
+} // namespace
+
#endif // WEB_ENGINE_CONTEXT_H
diff --git a/src/core/web_engine_error.cpp b/src/core/web_engine_error.cpp
index 7d83a42d7..0d326473b 100644
--- a/src/core/web_engine_error.cpp
+++ b/src/core/web_engine_error.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/web_engine_error.h b/src/core/web_engine_error.h
index 1d71df77f..793d9d615 100644
--- a/src/core/web_engine_error.h
+++ b/src/core/web_engine_error.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index c38fa6eb5..399e36765 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -1,8 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -12,24 +12,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -175,6 +178,24 @@ QString localesPath()
#endif
}
+#if defined(ENABLE_SPELLCHECK)
+QString dictionariesPath()
+{
+#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
+ return getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_dictionaries");
+#else
+ // first local path
+ static QString potentialDictionariesPath = QCoreApplication::applicationDirPath() % QDir::separator() % QLatin1String("qtwebengine_dictionaries");
+
+ // now global one
+ if (!QFileInfo::exists(potentialDictionariesPath))
+ potentialDictionariesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QDir::separator() % QLatin1String("qtwebengine_dictionaries");
+
+ return potentialDictionariesPath;
+#endif
+}
+#endif // ENABLE_SPELLCHECK
+
QString icuDataPath()
{
#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
@@ -240,6 +261,8 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_resources_100p.pak"));
case QT_RESOURCES_200P_PAK:
return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_resources_200p.pak"));
+ case QT_RESOURCES_DEVTOOLS_PAK:
+ return toFilePath(resourcesDataPath() % QLatin1String("/qtwebengine_devtools_resources.pak"));
case base::FILE_EXE:
case content::CHILD_PROCESS_EXE:
return toFilePath(subProcessPath());
@@ -258,6 +281,10 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
return toFilePath(icuDataPath());
case ui::DIR_LOCALES:
return toFilePath(localesPath());
+#if defined(ENABLE_SPELLCHECK)
+ case base::DIR_APP_DICTIONARIES:
+ return toFilePath(dictionariesPath());
+#endif
default:
// Note: the path system expects this function to override the default
// behavior. So no need to log an error if we don't support a given
diff --git a/src/core/web_engine_library_info.h b/src/core/web_engine_library_info.h
index cd3e5be94..a5cd914d3 100644
--- a/src/core/web_engine_library_info.h
+++ b/src/core/web_engine_library_info.h
@@ -1,8 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -12,24 +12,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -43,7 +46,8 @@
enum {
QT_RESOURCES_PAK = 5000,
QT_RESOURCES_100P_PAK = 5001,
- QT_RESOURCES_200P_PAK = 5002
+ QT_RESOURCES_200P_PAK = 5002,
+ QT_RESOURCES_DEVTOOLS_PAK = 5003
};
class WebEngineLibraryInfo {
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index ff67ed6a6..fb0f7e839 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,33 +11,42 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "web_engine_settings.h"
+
#include "web_contents_adapter.h"
+#include "web_engine_context.h"
#include "type_conversion.h"
+#include "base/command_line.h"
+#include "chrome/common/chrome_switches.h"
+#include "content/browser/gpu/gpu_process_host.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"
#include <QFont>
@@ -46,9 +55,9 @@
namespace QtWebEngineCore {
-QHash<WebEngineSettings::Attribute, bool> WebEngineSettings::m_defaultAttributes;
-QHash<WebEngineSettings::FontFamily, QString> WebEngineSettings::m_defaultFontFamilies;
-QHash<WebEngineSettings::FontSize, int> WebEngineSettings::m_defaultFontSizes;
+QHash<WebEngineSettings::Attribute, bool> WebEngineSettings::s_defaultAttributes;
+QHash<WebEngineSettings::FontFamily, QString> WebEngineSettings::s_defaultFontFamilies;
+QHash<WebEngineSettings::FontSize, int> WebEngineSettings::s_defaultFontSizes;
static const int batchTimerTimeout = 0;
@@ -128,20 +137,15 @@ void WebEngineSettings::setAttribute(WebEngineSettings::Attribute attr, bool on)
bool WebEngineSettings::testAttribute(WebEngineSettings::Attribute attr) const
{
if (!parentSettings) {
- Q_ASSERT(m_attributes.contains(attr));
- return m_attributes.value(attr);
+ Q_ASSERT(s_defaultAttributes.contains(attr));
+ return m_attributes.value(attr, s_defaultAttributes.value(attr));
}
return m_attributes.value(attr, parentSettings->testAttribute(attr));
}
void WebEngineSettings::resetAttribute(WebEngineSettings::Attribute attr)
{
- if (!parentSettings) {
- Q_ASSERT(m_defaultAttributes.contains(attr));
- m_attributes.insert(attr, m_defaultAttributes.value(attr));
- } else {
- m_attributes.remove(attr);
- }
+ m_attributes.remove(attr);
scheduleApplyRecursively();
}
@@ -154,20 +158,15 @@ void WebEngineSettings::setFontFamily(WebEngineSettings::FontFamily which, const
QString WebEngineSettings::fontFamily(WebEngineSettings::FontFamily which)
{
if (!parentSettings) {
- Q_ASSERT(m_fontFamilies.contains(which));
- return m_fontFamilies.value(which);
+ Q_ASSERT(s_defaultFontFamilies.contains(which));
+ return m_fontFamilies.value(which, s_defaultFontFamilies.value(which));
}
return m_fontFamilies.value(which, parentSettings->fontFamily(which));
}
void WebEngineSettings::resetFontFamily(WebEngineSettings::FontFamily which)
{
- if (!parentSettings) {
- Q_ASSERT(m_defaultFontFamilies.contains(which));
- m_fontFamilies.insert(which, m_defaultFontFamilies.value(which));
- } else {
- m_fontFamilies.remove(which);
- }
+ m_fontFamilies.remove(which);
scheduleApplyRecursively();
}
@@ -180,20 +179,15 @@ void WebEngineSettings::setFontSize(WebEngineSettings::FontSize type, int size)
int WebEngineSettings::fontSize(WebEngineSettings::FontSize type) const
{
if (!parentSettings) {
- Q_ASSERT(m_fontSizes.contains(type));
- return m_fontSizes.value(type);
+ Q_ASSERT(s_defaultFontSizes.contains(type));
+ return m_fontSizes.value(type, s_defaultFontSizes.value(type));
}
return m_fontSizes.value(type, parentSettings->fontSize(type));
}
void WebEngineSettings::resetFontSize(WebEngineSettings::FontSize type)
{
- if (!parentSettings) {
- Q_ASSERT(m_defaultFontSizes.contains(type));
- m_fontSizes.insert(type, m_defaultFontSizes.value(type));
- } else {
- m_fontSizes.remove(type);
- }
+ m_fontSizes.remove(type);
scheduleApplyRecursively();
}
@@ -212,54 +206,71 @@ QString WebEngineSettings::defaultTextEncoding() const
void WebEngineSettings::initDefaults(bool offTheRecord)
{
- if (m_defaultAttributes.isEmpty()) {
+ if (s_defaultAttributes.isEmpty()) {
// Initialize the default settings.
- m_defaultAttributes.insert(AutoLoadImages, true);
- m_defaultAttributes.insert(JavascriptEnabled, true);
- m_defaultAttributes.insert(JavascriptCanOpenWindows, true);
- m_defaultAttributes.insert(JavascriptCanAccessClipboard, false);
- m_defaultAttributes.insert(LinksIncludedInFocusChain, true);
- m_defaultAttributes.insert(LocalStorageEnabled, !offTheRecord);
- m_defaultAttributes.insert(LocalContentCanAccessRemoteUrls, false);
- m_defaultAttributes.insert(XSSAuditingEnabled, false);
- m_defaultAttributes.insert(SpatialNavigationEnabled, false);
- m_defaultAttributes.insert(LocalContentCanAccessFileUrls, true);
- m_defaultAttributes.insert(HyperlinkAuditingEnabled, false);
- m_defaultAttributes.insert(ScrollAnimatorEnabled, false);
- m_defaultAttributes.insert(ErrorPageEnabled, true);
- m_defaultAttributes.insert(PluginsEnabled, false);
- m_defaultAttributes.insert(FullScreenSupportEnabled, false);
+ s_defaultAttributes.insert(AutoLoadImages, true);
+ s_defaultAttributes.insert(JavascriptEnabled, true);
+ s_defaultAttributes.insert(JavascriptCanOpenWindows, true);
+ s_defaultAttributes.insert(JavascriptCanAccessClipboard, false);
+ s_defaultAttributes.insert(LinksIncludedInFocusChain, true);
+ s_defaultAttributes.insert(LocalStorageEnabled, true);
+ s_defaultAttributes.insert(LocalContentCanAccessRemoteUrls, false);
+ s_defaultAttributes.insert(XSSAuditingEnabled, false);
+ s_defaultAttributes.insert(SpatialNavigationEnabled, false);
+ s_defaultAttributes.insert(LocalContentCanAccessFileUrls, true);
+ s_defaultAttributes.insert(HyperlinkAuditingEnabled, false);
+ s_defaultAttributes.insert(ErrorPageEnabled, true);
+ s_defaultAttributes.insert(PluginsEnabled, false);
+ s_defaultAttributes.insert(FullScreenSupportEnabled, false);
+ s_defaultAttributes.insert(ScreenCaptureEnabled, false);
+ // The following defaults matches logic in render_view_host_impl.cc
+ // But first we must ensure the WebContext has been initialized
+ QtWebEngineCore::WebEngineContext::current();
+ base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess();
+ bool smoothScrolling = commandLine->HasSwitch(switches::kEnableSmoothScrolling);
+ bool webGL = content::GpuProcessHost::gpu_enabled() &&
+ !commandLine->HasSwitch(switches::kDisable3DAPIs) &&
+ !commandLine->HasSwitch(switches::kDisableExperimentalWebGL);
+ bool accelerated2dCanvas = content::GpuProcessHost::gpu_enabled() &&
+ !commandLine->HasSwitch(switches::kDisableAccelerated2dCanvas);
+ bool allowRunningInsecureContent = commandLine->HasSwitch(switches::kAllowRunningInsecureContent);
+ s_defaultAttributes.insert(ScrollAnimatorEnabled, smoothScrolling);
+ s_defaultAttributes.insert(WebGLEnabled, webGL);
+ s_defaultAttributes.insert(Accelerated2dCanvasEnabled, accelerated2dCanvas);
+ s_defaultAttributes.insert(AutoLoadIconsForPage, true);
+ s_defaultAttributes.insert(TouchIconsEnabled, false);
+ s_defaultAttributes.insert(AllowRunningInsecureContent, allowRunningInsecureContent);
}
- m_attributes = m_defaultAttributes;
+ if (offTheRecord)
+ m_attributes.insert(LocalStorageEnabled, false);
- if (m_defaultFontFamilies.isEmpty()) {
+ if (s_defaultFontFamilies.isEmpty()) {
// Default fonts
QFont defaultFont;
defaultFont.setStyleHint(QFont::Serif);
- m_defaultFontFamilies.insert(StandardFont, defaultFont.defaultFamily());
- m_defaultFontFamilies.insert(SerifFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(StandardFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(SerifFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(PictographFont, defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::Fantasy);
- m_defaultFontFamilies.insert(FantasyFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(FantasyFont, defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::Cursive);
- m_defaultFontFamilies.insert(CursiveFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(CursiveFont, defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::SansSerif);
- m_defaultFontFamilies.insert(SansSerifFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(SansSerifFont, defaultFont.defaultFamily());
defaultFont.setStyleHint(QFont::Monospace);
- m_defaultFontFamilies.insert(FixedFont, defaultFont.defaultFamily());
+ s_defaultFontFamilies.insert(FixedFont, defaultFont.defaultFamily());
}
- m_fontFamilies = m_defaultFontFamilies;
- if (m_defaultFontSizes.isEmpty()) {
- m_defaultFontSizes.insert(MinimumFontSize, 0);
- m_defaultFontSizes.insert(MinimumLogicalFontSize, 6);
- m_defaultFontSizes.insert(DefaultFixedFontSize, 13);
- m_defaultFontSizes.insert(DefaultFontSize, 16);
+ if (s_defaultFontSizes.isEmpty()) {
+ s_defaultFontSizes.insert(MinimumFontSize, 0);
+ s_defaultFontSizes.insert(MinimumLogicalFontSize, 6);
+ s_defaultFontSizes.insert(DefaultFixedFontSize, 13);
+ s_defaultFontSizes.insert(DefaultFontSize, 16);
}
- m_fontSizes = m_defaultFontSizes;
m_defaultEncoding = QStringLiteral("ISO-8859-1");
}
@@ -284,7 +295,6 @@ void WebEngineSettings::doApply()
void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *prefs)
{
// Override for now
- prefs->java_enabled = false;
prefs->touch_enabled = isTouchScreenAvailable();
// Attributes mapping.
@@ -294,6 +304,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p
prefs->javascript_can_access_clipboard = testAttribute(JavascriptCanAccessClipboard);
prefs->tabs_to_links = testAttribute(LinksIncludedInFocusChain);
prefs->local_storage_enabled = testAttribute(LocalStorageEnabled);
+ prefs->databases_enabled = testAttribute(LocalStorageEnabled);
prefs->allow_universal_access_from_file_urls = testAttribute(LocalContentCanAccessRemoteUrls);
prefs->xss_auditor_enabled = testAttribute(XSSAuditingEnabled);
prefs->spatial_navigation_enabled = testAttribute(SpatialNavigationEnabled);
@@ -303,6 +314,9 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p
prefs->enable_error_page = testAttribute(ErrorPageEnabled);
prefs->plugins_enabled = testAttribute(PluginsEnabled);
prefs->fullscreen_supported = testAttribute(FullScreenSupportEnabled);
+ prefs->accelerated_2d_canvas_enabled = testAttribute(Accelerated2dCanvasEnabled);
+ prefs->experimental_webgl_enabled = testAttribute(WebGLEnabled);
+ prefs->allow_running_insecure_content = testAttribute(AllowRunningInsecureContent);
// Fonts settings.
prefs->standard_font_family_map[content::kCommonScript] = toString16(fontFamily(StandardFont));
@@ -311,8 +325,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p
prefs->sans_serif_font_family_map[content::kCommonScript] = toString16(fontFamily(SansSerifFont));
prefs->cursive_font_family_map[content::kCommonScript] = toString16(fontFamily(CursiveFont));
prefs->fantasy_font_family_map[content::kCommonScript] = toString16(fontFamily(FantasyFont));
- // FIXME: add pictograph?
- // prefs.pictograph_font_family_map[content::kCommonScript] = toString16(fontFamily());
+ prefs->pictograph_font_family_map[content::kCommonScript] = toString16(fontFamily(PictographFont));
prefs->default_font_size = fontSize(DefaultFontSize);
prefs->default_fixed_font_size = fontSize(DefaultFixedFontSize);
prefs->minimum_font_size = fontSize(MinimumFontSize);
diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h
index 3036a31a6..e131af50c 100644
--- a/src/core/web_engine_settings.h
+++ b/src/core/web_engine_settings.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -72,6 +75,12 @@ public:
ErrorPageEnabled,
PluginsEnabled,
FullScreenSupportEnabled,
+ ScreenCaptureEnabled,
+ WebGLEnabled,
+ Accelerated2dCanvasEnabled,
+ AutoLoadIconsForPage,
+ TouchIconsEnabled,
+ AllowRunningInsecureContent
};
// Must match the values from the public API in qwebenginesettings.h.
@@ -81,7 +90,8 @@ public:
SerifFont,
SansSerifFont,
CursiveFont,
- FantasyFont
+ FantasyFont,
+ PictographFont
};
// Must match the values from the public API in qwebenginesettings.h.
@@ -135,9 +145,9 @@ private:
WebEngineSettings *parentSettings;
QSet<WebEngineSettings *> childSettings;
- static QHash<Attribute, bool> m_defaultAttributes;
- static QHash<FontFamily, QString> m_defaultFontFamilies;
- static QHash<FontSize, int> m_defaultFontSizes;
+ static QHash<Attribute, bool> s_defaultAttributes;
+ static QHash<FontFamily, QString> s_defaultFontFamilies;
+ static QHash<FontSize, int> s_defaultFontSizes;
friend class BatchTimer;
friend class WebContentsAdapter;
diff --git a/src/core/web_engine_visited_links_manager.cpp b/src/core/web_engine_visited_links_manager.cpp
index deee26523..ded9d5d24 100644
--- a/src/core/web_engine_visited_links_manager.cpp
+++ b/src/core/web_engine_visited_links_manager.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/web_engine_visited_links_manager.h b/src/core/web_engine_visited_links_manager.h
index afbc414a3..eab2b9610 100644
--- a/src/core/web_engine_visited_links_manager.h
+++ b/src/core/web_engine_visited_links_manager.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index d6b2f4ba9..80850af70 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/web_event_factory.h b/src/core/web_event_factory.h
index 80c9929c5..b70da44a3 100644
--- a/src/core/web_event_factory.h
+++ b/src/core/web_event_factory.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/core/yuv_video_node.cpp b/src/core/yuv_video_node.cpp
index 7deeb5802..f8290878b 100644
--- a/src/core/yuv_video_node.cpp
+++ b/src/core/yuv_video_node.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,29 +11,37 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
+// Based on cc/output/gl_renderer.cc and cc/output/shader.cc:
+// Copyright 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
#include "yuv_video_node.h"
#include <QtGui/qopenglcontext.h>
diff --git a/src/core/yuv_video_node.h b/src/core/yuv_video_node.h
index 5b13879d3..cce204fd3 100644
--- a/src/core/yuv_video_node.h
+++ b/src/core/yuv_video_node.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**