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

Unified Diff: chrome/browser/sessions/session_service.cc

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 0dda61c1c432dd03f77f5ddc05a0e049c8fcf471..546adcc2283e8e45a8ebd8eda71c0429dc96daca 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -589,7 +589,7 @@ void SessionService::Observe(int type,
TabNavigationPathPrunedFromBack(
tab->restore_tab_helper()->window_id(),
tab->restore_tab_helper()->session_id(),
- tab->controller().entry_count());
+ tab->tab_contents()->controller().entry_count());
}
RecordSessionUpdateHistogramData(content::NOTIFICATION_NAV_LIST_PRUNED,
&last_updated_nav_list_pruned_time_);
@@ -618,7 +618,8 @@ void SessionService::Observe(int type,
source).ptr()->tab_contents());
if (!tab || tab->profile() != profile())
return;
- int current_entry_index = tab->controller().GetCurrentEntryIndex();
+ int current_entry_index =
+ tab->tab_contents()->controller().GetCurrentEntryIndex();
SetSelectedNavigationIndex(tab->restore_tab_helper()->window_id(),
tab->restore_tab_helper()->session_id(),
current_entry_index);
@@ -626,7 +627,8 @@ void SessionService::Observe(int type,
tab->restore_tab_helper()->window_id(),
tab->restore_tab_helper()->session_id(),
current_entry_index,
- *tab->controller().GetEntryAtIndex(current_entry_index));
+ *tab->tab_contents()->controller().GetEntryAtIndex(
+ current_entry_index));
content::Details<content::LoadCommittedDetails> changed(details);
if (changed->type == content::NAVIGATION_TYPE_NEW_PAGE ||
changed->type == content::NAVIGATION_TYPE_EXISTING_PAGE) {
@@ -1140,12 +1142,15 @@ void SessionService::BuildCommandsForTab(
DCHECK(tab && commands && window_id.id());
const SessionID& session_id(tab->restore_tab_helper()->session_id());
commands->push_back(CreateSetTabWindowCommand(window_id, session_id));
- const int current_index = tab->controller().GetCurrentEntryIndex();
+ const int current_index =
+ tab->tab_contents()->controller().GetCurrentEntryIndex();
const int min_index = std::max(0,
current_index - max_persist_navigation_count);
- const int max_index = std::min(current_index + max_persist_navigation_count,
- tab->controller().entry_count());
- const int pending_index = tab->controller().pending_entry_index();
+ const int max_index =
+ std::min(current_index + max_persist_navigation_count,
+ tab->tab_contents()->controller().entry_count());
+ const int pending_index =
+ tab->tab_contents()->controller().pending_entry_index();
if (tab_to_available_range) {
(*tab_to_available_range)[session_id.id()] =
std::pair<int, int>(min_index, max_index);
@@ -1163,8 +1168,8 @@ void SessionService::BuildCommandsForTab(
}
for (int i = min_index; i < max_index; ++i) {
const NavigationEntry* entry = (i == pending_index) ?
- tab->controller().pending_entry() :
- tab->controller().GetEntryAtIndex(i);
+ tab->tab_contents()->controller().pending_entry() :
+ tab->tab_contents()->controller().GetEntryAtIndex(i);
DCHECK(entry);
if (ShouldTrackEntry(entry->virtual_url())) {
commands->push_back(
« no previous file with comments | « chrome/browser/sessions/restore_tab_helper.cc ('k') | chrome/browser/tab_contents/tab_contents_ssl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698