summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 00:35:18 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 00:35:18 +0000
commit63931bd97ba41089edb259b906e0869b3de96c70 (patch)
tree046432910b29d53530c453084830416acf94882d /chrome/browser/sessions
parenta9dbbaa4d0586c125b0f661ff836c54fedd74504 (diff)
downloadchromium_src-63931bd97ba41089edb259b906e0869b3de96c70.zip
chromium_src-63931bd97ba41089edb259b906e0869b3de96c70.tar.gz
chromium_src-63931bd97ba41089edb259b906e0869b3de96c70.tar.bz2
Clean up SessionService::BuildCommandsForBrowser.
BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/11364205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/session_service.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 229b360..ae8085c 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -1389,20 +1389,15 @@ void SessionService::BuildCommandsForBrowser(
browser->app_name()));
}
- bool added_to_windows_to_track = false;
+ windows_to_track->insert(browser->session_id().id());
for (int i = 0; i < browser->tab_count(); ++i) {
TabContents* tab = chrome::GetTabContentsAt(browser, i);
DCHECK(tab);
- if (tab->profile() == profile() || profile() == NULL) {
- BuildCommandsForTab(browser->session_id(), tab, i,
- browser->tab_strip_model()->IsTabPinned(i),
- commands, tab_to_available_range);
- if (windows_to_track && !added_to_windows_to_track) {
- windows_to_track->insert(browser->session_id().id());
- added_to_windows_to_track = true;
- }
- }
+ BuildCommandsForTab(browser->session_id(), tab, i,
+ browser->tab_strip_model()->IsTabPinned(i),
+ commands, tab_to_available_range);
}
+
commands->push_back(
CreateSetSelectedTabInWindow(browser->session_id(),
browser->active_index()));
@@ -1416,9 +1411,9 @@ void SessionService::BuildCommandsFromBrowsers(
for (BrowserList::const_iterator i = BrowserList::begin();
i != BrowserList::end(); ++i) {
Browser* browser = *i;
- // Make sure the browser has tabs and a window. Browsers destructor
+ // Make sure the browser has tabs and a window. Browser's destructor
// removes itself from the BrowserList. When a browser is closed the
- // destructor is not necessarily run immediately. This means its possible
+ // destructor is not necessarily run immediately. This means it's possible
// for us to get a handle to a browser that is about to be removed. If
// the tab count is 0 or the window is NULL, the browser is about to be
// deleted, so we ignore it.