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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 341043: Changes session restore to use a normal load rather than preferring... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 30525)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -180,14 +180,26 @@
}
#endif
-void MakeNavigateParams(const NavigationEntry& entry, bool reload,
- ViewMsg_Navigate_Params* params) {
+ViewMsg_Navigate_Params::NavigationType GetNavigationType(
+ Profile* profile, const NavigationEntry& entry, bool reload) {
+ if (reload)
+ return ViewMsg_Navigate_Params::RELOAD;
+
+ if (entry.restore_type() == NavigationEntry::RESTORE_LAST_SESSION &&
+ profile->DidLastSessionExitCleanly())
+ return ViewMsg_Navigate_Params::RESTORE;
+
+ return ViewMsg_Navigate_Params::NORMAL;
+}
+
+void MakeNavigateParams(Profile* profile, const NavigationEntry& entry,
+ bool reload, ViewMsg_Navigate_Params* params) {
params->page_id = entry.page_id();
params->url = entry.url();
params->referrer = entry.referrer();
params->transition = entry.transition_type();
params->state = entry.content_state();
- params->reload = reload;
+ params->navigation_type = GetNavigationType(profile, entry, reload);
params->request_time = base::Time::Now();
}
@@ -693,7 +705,7 @@
// Navigate in the desired RenderViewHost.
ViewMsg_Navigate_Params navigate_params;
- MakeNavigateParams(entry, reload, &navigate_params);
+ MakeNavigateParams(profile(), entry, reload, &navigate_params);
dest_render_view_host->Navigate(navigate_params);
if (entry.page_id() == -1) {
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698