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

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

Issue 672083002: Refactoring of SessionService to get componentized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switched back to #2 and addressed points Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/persistent_tab_restore_service.cc
diff --git a/chrome/browser/sessions/persistent_tab_restore_service.cc b/chrome/browser/sessions/persistent_tab_restore_service.cc
index f0be5620b3c17c876b15f9e72351441ba5563451..b139a2aec3af6cbd2c22a5921189c15f020aa19c 100644
--- a/chrome/browser/sessions/persistent_tab_restore_service.cc
+++ b/chrome/browser/sessions/persistent_tab_restore_service.cc
@@ -19,6 +19,7 @@
#include "base/time/time.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/base_session_service.h"
+#include "chrome/browser/sessions/base_session_service_commands.h"
#include "chrome/browser/sessions/base_session_service_delegate_impl.h"
#include "chrome/browser/sessions/session_command.h"
#include "chrome/browser/sessions/session_service.h"
@@ -413,10 +414,9 @@ void PersistentTabRestoreService::Delegate::ScheduleCommandsForWindow(
window.timestamp));
if (!window.app_name.empty()) {
- ScheduleCommand(
- CreateSetWindowAppNameCommand(kCommandSetWindowAppName,
- window.id,
- window.app_name));
+ ScheduleCommand(::CreateSetWindowAppNameCommand(kCommandSetWindowAppName,
sky 2014/10/28 22:52:38 Why do you need the :: in all of these?
Mr4D (OOO till 08-26) 2014/10/29 02:04:13 Actually - I do not need them here. Removed.
+ window.id,
+ window.app_name));
}
for (size_t i = 0; i < window.tabs.size(); ++i) {
@@ -459,24 +459,27 @@ void PersistentTabRestoreService::Delegate::ScheduleCommandsForTab(
}
if (!tab.extension_app_id.empty()) {
- ScheduleCommand(
- CreateSetTabExtensionAppIDCommand(kCommandSetExtensionAppID, tab.id,
- tab.extension_app_id));
+ ScheduleCommand(::CreateSetTabExtensionAppIDCommand(
+ kCommandSetExtensionAppID,
+ tab.id,
+ tab.extension_app_id));
}
if (!tab.user_agent_override.empty()) {
- ScheduleCommand(
- CreateSetTabUserAgentOverrideCommand(kCommandSetTabUserAgentOverride,
- tab.id, tab.user_agent_override));
+ ScheduleCommand(::CreateSetTabUserAgentOverrideCommand(
+ kCommandSetTabUserAgentOverride,
+ tab.id,
+ tab.user_agent_override));
}
// Then write the navigations.
for (int i = first_index_to_persist, wrote_count = 0;
i < max_index && wrote_count < 2 * max_persist_navigation_count; ++i) {
if (ShouldTrackEntry(navigations[i].virtual_url())) {
- ScheduleCommand(
- CreateUpdateTabNavigationCommand(kCommandUpdateTabNavigation, tab.id,
- navigations[i]));
+ ScheduleCommand(::CreateUpdateTabNavigationCommand(
+ kCommandUpdateTabNavigation,
+ tab.id,
+ navigations[i]));
}
}
}
@@ -686,8 +689,9 @@ void PersistentTabRestoreService::Delegate::CreateEntriesFromCommands(
}
current_tab->navigations.resize(current_tab->navigations.size() + 1);
SessionID::id_type tab_id;
- if (!RestoreUpdateTabNavigationCommand(
- command, &current_tab->navigations.back(), &tab_id)) {
+ if (!RestoreUpdateTabNavigationCommand(command,
+ &current_tab->navigations.back(),
+ &tab_id)) {
return;
}
break;
@@ -727,7 +731,8 @@ void PersistentTabRestoreService::Delegate::CreateEntriesFromCommands(
}
SessionID::id_type tab_id;
std::string extension_app_id;
- if (!RestoreSetTabExtensionAppIDCommand(command, &tab_id,
+ if (!RestoreSetTabExtensionAppIDCommand(command,
+ &tab_id,
&extension_app_id)) {
return;
}
@@ -742,7 +747,8 @@ void PersistentTabRestoreService::Delegate::CreateEntriesFromCommands(
}
SessionID::id_type tab_id;
std::string user_agent_override;
- if (!RestoreSetTabUserAgentOverrideCommand(command, &tab_id,
+ if (!RestoreSetTabUserAgentOverrideCommand(command,
+ &tab_id,
&user_agent_override)) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698