summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2015-03-05 05:07:04 -0800
committerSzabolcs David <davidsz@inf.u-szeged.hu>2015-03-16 11:25:30 +0000
commit6cbeac50922b72e6d6783c531611eafc95f4c91a (patch)
treeb0aae77ac69c2509880b146f6cd2dc73bb3b257a /src/core/web_contents_delegate_qt.cpp
parentd433826c7d0514228b44f0c30ec7e545a3c179bb (diff)
Support middle click navigation
When the user does a middle click on a link which originally opens a new tab (target="_blank"), the newly created RenderView is hidden, so the new tab has no visible content. We need to unhide it explicitly. This also adds background tab support for the Quick example browsers and fixes the profile mismatching warning in the case when we adopt a new tab without WebContents. Change-Id: Ia3c2e752a4784d32133cee0ff278c2849b151582 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index e0fb3d7d8..409514411 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -49,6 +49,7 @@
#include "web_engine_settings.h"
#include "web_engine_visited_links_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"
@@ -60,6 +61,7 @@
#include "content/public/common/frame_navigate_params.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
+#include "ui/events/latency_info.h"
namespace QtWebEngineCore {
@@ -115,9 +117,13 @@ void WebContentsDelegateQt::NavigationStateChanged(const content::WebContents* s
void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked)
{
+ Q_UNUSED(source)
WebContentsAdapter *newAdapter = createWindow(new_contents, disposition, initial_pos, user_gesture);
if (was_blocked)
*was_blocked = !newAdapter;
+
+ if (content::RenderWidgetHostImpl *impl = content::RenderWidgetHostImpl::From(new_contents->GetRenderViewHost()))
+ impl->WasShown(ui::LatencyInfo());
}
void WebContentsDelegateQt::CloseContents(content::WebContents *source)