summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarshall@chromium.org <marshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 15:41:43 +0000
committermarshall@chromium.org <marshall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 15:41:43 +0000
commit6bf6a6b5d49a40337a08b07d5f3b393346ead061 (patch)
tree4a92d09b30592b381b97a543425ceafe8bc1abc3
parent23211fbcc81a80f4221d2b37a18c646a6730fa4b (diff)
downloadchromium_src-6bf6a6b5d49a40337a08b07d5f3b393346ead061.zip
chromium_src-6bf6a6b5d49a40337a08b07d5f3b393346ead061.tar.gz
chromium_src-6bf6a6b5d49a40337a08b07d5f3b393346ead061.tar.bz2
Add a source_frame_id member to OpenURLParams for passage to WebContentsDelegate::OpenURLFromTab. This is necessary in order for the browser to open the request in the correct frame.
BUG=112289 TEST=NONE Review URL: https://chromiumcodereview.appspot.com/9283033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120333 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/tab_contents/tab_contents.cc4
-rw-r--r--content/public/browser/page_navigator.cc21
-rw-r--r--content/public/browser/page_navigator.h11
3 files changed, 31 insertions, 5 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 78b8024..1fc4bfa 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -1994,14 +1994,14 @@ void TabContents::RequestTransferURL(const GURL& url,
// want web sites to see a referrer of "chrome://blah" (and some
// chrome: URLs might have search terms or other stuff we don't want to
// send to the site), so we send no referrer.
- OpenURLParams params(url, content::Referrer(), disposition,
+ OpenURLParams params(url, content::Referrer(), source_frame_id, disposition,
render_manager_.web_ui()->GetLinkTransitionType(),
false /* is_renderer_initiated */);
params.transferred_global_request_id = old_request_id;
new_contents = OpenURL(params);
transition_type = render_manager_.web_ui()->GetLinkTransitionType();
} else {
- OpenURLParams params(url, referrer, disposition,
+ OpenURLParams params(url, referrer, source_frame_id, disposition,
content::PAGE_TRANSITION_LINK, true /* is_renderer_initiated */);
params.transferred_global_request_id = old_request_id;
new_contents = OpenURL(params);
diff --git a/content/public/browser/page_navigator.cc b/content/public/browser/page_navigator.cc
index b37ea4b..029afbc 100644
--- a/content/public/browser/page_navigator.cc
+++ b/content/public/browser/page_navigator.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -14,13 +14,30 @@ OpenURLParams::OpenURLParams(
bool is_renderer_initiated)
: url(url),
referrer(referrer),
+ source_frame_id(-1),
+ disposition(disposition),
+ transition(transition),
+ is_renderer_initiated(is_renderer_initiated) {
+}
+
+OpenURLParams::OpenURLParams(
+ const GURL& url,
+ const Referrer& referrer,
+ int64 source_frame_id,
+ WindowOpenDisposition disposition,
+ PageTransition transition,
+ bool is_renderer_initiated)
+ : url(url),
+ referrer(referrer),
+ source_frame_id(source_frame_id),
disposition(disposition),
transition(transition),
is_renderer_initiated(is_renderer_initiated) {
}
OpenURLParams::OpenURLParams()
- : disposition(UNKNOWN),
+ : source_frame_id(-1),
+ disposition(UNKNOWN),
transition(PageTransitionFromInt(0)),
is_renderer_initiated(false) {
}
diff --git a/content/public/browser/page_navigator.h b/content/public/browser/page_navigator.h
index 0fded4e..5296d557 100644
--- a/content/public/browser/page_navigator.h
+++ b/content/public/browser/page_navigator.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -29,12 +29,21 @@ struct CONTENT_EXPORT OpenURLParams {
WindowOpenDisposition disposition,
PageTransition transition,
bool is_renderer_initiated);
+ OpenURLParams(const GURL& url,
+ const Referrer& referrer,
+ int64 source_frame_id,
+ WindowOpenDisposition disposition,
+ PageTransition transition,
+ bool is_renderer_initiated);
~OpenURLParams();
// The URL/referrer to be opened.
GURL url;
Referrer referrer;
+ // The source frame id or -1 to indicate the main frame.
+ int64 source_frame_id;
+
// The disposition requested by the navigation source.
WindowOpenDisposition disposition;