diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 24 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.h | 1 |
2 files changed, 25 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) diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 1772190fd..fe36088eb 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -63,6 +63,7 @@ class WebContentsDelegateQt : public content::WebContentsDelegate public: WebContentsDelegateQt(content::WebContents*, WebContentsAdapterClient *adapterClient); + virtual content::WebContents *OpenURLFromTab(content::WebContents *source, const content::OpenURLParams ¶ms) Q_DECL_OVERRIDE; virtual void NavigationStateChanged(const content::WebContents* source, unsigned changed_flags) Q_DECL_OVERRIDE; virtual void AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) Q_DECL_OVERRIDE; virtual void CloseContents(content::WebContents *source) Q_DECL_OVERRIDE; |