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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 1131373003: [Session restore] Add MRU logic to loading of background pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 // Show the loading state (if any). 1064 // Show the loading state (if any).
1065 status_bubble->SetStatus(CoreTabHelper::FromWebContents( 1065 status_bubble->SetStatus(CoreTabHelper::FromWebContents(
1066 tab_strip_model_->GetActiveWebContents())->GetStatusText()); 1066 tab_strip_model_->GetActiveWebContents())->GetStatusText());
1067 } 1067 }
1068 1068
1069 if (HasFindBarController()) { 1069 if (HasFindBarController()) {
1070 find_bar_controller_->ChangeWebContents(new_contents); 1070 find_bar_controller_->ChangeWebContents(new_contents);
1071 find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect()); 1071 find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect());
1072 } 1072 }
1073 1073
1074 // Update sessions. Don't force creation of sessions. If sessions doesn't 1074 // Update sessions (selected tab index and last activation time). Don't force
1075 // exist, the change will be picked up by sessions when created. 1075 // creation of sessions. If sessions doesn't exist, the change will be picked
1076 // up by sessions when created.
1076 SessionService* session_service = 1077 SessionService* session_service =
1077 SessionServiceFactory::GetForProfileIfExisting(profile_); 1078 SessionServiceFactory::GetForProfileIfExisting(profile_);
1078 if (session_service && !tab_strip_model_->closing_all()) { 1079 if (session_service && !tab_strip_model_->closing_all()) {
1079 session_service->SetSelectedTabInWindow(session_id(), 1080 session_service->SetSelectedTabInWindow(session_id(),
1080 tab_strip_model_->active_index()); 1081 tab_strip_model_->active_index());
1082 SessionTabHelper* session_tab_helper =
1083 SessionTabHelper::FromWebContents(new_contents);
1084 session_service->SetActivationTime(
sky 2015/05/12 21:25:30 I think you should only do this if the tab is acti
Georges Khalil 2015/05/15 16:55:30 The length if the activation is something that's g
sky 2015/05/22 03:00:19 Can you outline where you're thinking you'll go wi
Georges Khalil 2015/05/22 20:14:09 Forgot to mention that we need to keep them separa
sky 2015/05/22 20:25:30 We could change session restore to not only keep o
1085 session_id(), session_tab_helper->session_id(), base::TimeTicks::Now());
1081 } 1086 }
1082 1087
1083 // This needs to be called after notifying SearchDelegate. 1088 // This needs to be called after notifying SearchDelegate.
1084 if (instant_controller_) 1089 if (instant_controller_)
1085 instant_controller_->ActiveTabChanged(); 1090 instant_controller_->ActiveTabChanged();
1086 1091
1087 autofill::ChromeAutofillClient::FromWebContents(new_contents)->TabActivated(); 1092 autofill::ChromeAutofillClient::FromWebContents(new_contents)->TabActivated();
1088 SearchTabHelper::FromWebContents(new_contents)->OnTabActivated(); 1093 SearchTabHelper::FromWebContents(new_contents)->OnTabActivated();
1089 } 1094 }
1090 1095
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 if (contents && !allow_js_access) { 2608 if (contents && !allow_js_access) {
2604 contents->web_contents()->GetController().LoadURL( 2609 contents->web_contents()->GetController().LoadURL(
2605 target_url, 2610 target_url,
2606 content::Referrer(), 2611 content::Referrer(),
2607 ui::PAGE_TRANSITION_LINK, 2612 ui::PAGE_TRANSITION_LINK,
2608 std::string()); // No extra headers. 2613 std::string()); // No extra headers.
2609 } 2614 }
2610 2615
2611 return contents != NULL; 2616 return contents != NULL;
2612 } 2617 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698