Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 8774050: Pass along the referrer policy (renderer side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tab_contents/tab_contents.h" 5 #include "content/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 void MakeNavigateParams(const NavigationEntry& entry, 153 void MakeNavigateParams(const NavigationEntry& entry,
154 const NavigationController& controller, 154 const NavigationController& controller,
155 TabContentsDelegate* delegate, 155 TabContentsDelegate* delegate,
156 NavigationController::ReloadType reload_type, 156 NavigationController::ReloadType reload_type,
157 ViewMsg_Navigate_Params* params) { 157 ViewMsg_Navigate_Params* params) {
158 params->page_id = entry.page_id(); 158 params->page_id = entry.page_id();
159 params->pending_history_list_offset = controller.GetIndexOfEntry(&entry); 159 params->pending_history_list_offset = controller.GetIndexOfEntry(&entry);
160 params->current_history_list_offset = controller.last_committed_entry_index(); 160 params->current_history_list_offset = controller.last_committed_entry_index();
161 params->current_history_list_length = controller.entry_count(); 161 params->current_history_list_length = controller.entry_count();
162 params->url = entry.url(); 162 params->url = entry.url();
163 params->referrer = entry.referrer(); 163 params->referrer = content::Referrer(entry.referrer(),
164 WebKit::WebReferrerPolicyDefault);
164 params->transition = entry.transition_type(); 165 params->transition = entry.transition_type();
165 params->state = entry.content_state(); 166 params->state = entry.content_state();
166 params->navigation_type = 167 params->navigation_type =
167 GetNavigationType(controller.browser_context(), entry, reload_type); 168 GetNavigationType(controller.browser_context(), entry, reload_type);
168 params->request_time = base::Time::Now(); 169 params->request_time = base::Time::Now();
169 params->extra_headers = entry.extra_headers(); 170 params->extra_headers = entry.extra_headers();
170 params->transferred_request_child_id = 171 params->transferred_request_child_id =
171 entry.transferred_global_request_id().child_id; 172 entry.transferred_global_request_id().child_id;
172 params->transferred_request_request_id = 173 params->transferred_request_request_id =
173 entry.transferred_global_request_id().request_id; 174 entry.transferred_global_request_id().request_id;
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 void TabContents::DocumentOnLoadCompletedInMainFrame( 1745 void TabContents::DocumentOnLoadCompletedInMainFrame(
1745 RenderViewHost* render_view_host, 1746 RenderViewHost* render_view_host,
1746 int32 page_id) { 1747 int32 page_id) {
1747 content::NotificationService::current()->Notify( 1748 content::NotificationService::current()->Notify(
1748 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 1749 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
1749 content::Source<TabContents>(this), 1750 content::Source<TabContents>(this),
1750 content::Details<int>(&page_id)); 1751 content::Details<int>(&page_id));
1751 } 1752 }
1752 1753
1753 void TabContents::RequestOpenURL(const GURL& url, 1754 void TabContents::RequestOpenURL(const GURL& url,
1754 const GURL& referrer, 1755 const content::Referrer& referrer,
1755 WindowOpenDisposition disposition, 1756 WindowOpenDisposition disposition,
1756 int64 source_frame_id) { 1757 int64 source_frame_id) {
1757 // Delegate to RequestTransferURL because this is just the generic 1758 // Delegate to RequestTransferURL because this is just the generic
1758 // case where |old_request_id| is empty. 1759 // case where |old_request_id| is empty.
1759 RequestTransferURL(url, referrer, disposition, source_frame_id, 1760 RequestTransferURL(url, referrer.url, disposition, source_frame_id,
1760 GlobalRequestID()); 1761 GlobalRequestID());
1761 } 1762 }
1762 1763
1763 void TabContents::RequestTransferURL(const GURL& url, 1764 void TabContents::RequestTransferURL(const GURL& url,
1764 const GURL& referrer, 1765 const GURL& referrer,
1765 WindowOpenDisposition disposition, 1766 WindowOpenDisposition disposition,
1766 int64 source_frame_id, 1767 int64 source_frame_id,
1767 const GlobalRequestID& old_request_id) { 1768 const GlobalRequestID& old_request_id) {
1768 TabContents* new_contents = NULL; 1769 TabContents* new_contents = NULL;
1769 content::PageTransition transition_type = content::PAGE_TRANSITION_LINK; 1770 content::PageTransition transition_type = content::PAGE_TRANSITION_LINK;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2078 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2078 // Can be NULL during tests. 2079 // Can be NULL during tests.
2079 if (rwh_view) 2080 if (rwh_view)
2080 rwh_view->SetSize(view()->GetContainerSize()); 2081 rwh_view->SetSize(view()->GetContainerSize());
2081 } 2082 }
2082 2083
2083 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2084 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2084 return render_view_host() ? 2085 return render_view_host() ?
2085 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2086 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2086 } 2087 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698