diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-04-15 16:38:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-15 21:55:08 +0200 |
commit | d827b5d885355849c96c7c7d218d6e6b4eaec25b (patch) | |
tree | 30d56db68f45ac6e5ad710b238ce0159abf28e47 /src/core/web_contents_delegate_qt.cpp | |
parent | 57df94104a8c8fa524492811dc4a92db8cd1263a (diff) |
Fix links not opening on Google+ and Gmail
We missed a very important overload of WebContentsDelegate used by
window.open to navigate new pages. The logic is mostly taken from
chromium/content/shell/browser/shell.cc.
Change-Id: Ib359edb61c1ee6eab89e2ebdc2aad2d944fea712
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 8c5646ab5..6e19fd9ab 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -39,6 +39,10 @@ ** ****************************************************************************/ +// 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 "web_contents_delegate_qt.h" #include "type_conversion.h" @@ -72,6 +76,26 @@ WebContentsDelegateQt::WebContentsDelegateQt(content::WebContents *webContents, Observe(webContents); } +content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents *source, const content::OpenURLParams ¶ms) +{ + // We already carry the disposition to the application through AddNewContents. + Q_UNUSED(params.disposition); + + content::NavigationController::LoadURLParams load_url_params(params.url); + load_url_params.referrer = params.referrer; + load_url_params.frame_tree_node_id = params.frame_tree_node_id; + 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; + + if (params.transferred_global_request_id != content::GlobalRequestID()) + load_url_params.transferred_global_request_id = params.transferred_global_request_id; + + source->GetController().LoadURLWithParams(load_url_params); + return source; +} + void WebContentsDelegateQt::NavigationStateChanged(const content::WebContents* source, unsigned changed_flags) { if (changed_flags & content::INVALIDATE_TYPE_URL) |