Chromium Code Reviews| Index: chrome/browser/ui/webui/sessions_ui.cc |
| diff --git a/chrome/browser/ui/webui/sessions_ui.cc b/chrome/browser/ui/webui/sessions_ui.cc |
| index 06382522ba6087b4760b1fc2ca815674c6c0f976..40b07ba29319d70c9b009d1fad6ba184c0653b67 100644 |
| --- a/chrome/browser/ui/webui/sessions_ui.cc |
| +++ b/chrome/browser/ui/webui/sessions_ui.cc |
| @@ -78,8 +78,9 @@ class SessionsDOMHandler : public WebUIMessageHandler { |
| void GetTabList(const std::vector<SessionTab*>& tabs, ListValue* tab_list); |
| // Appends each entry in |windows| to |window_list| as a DictonaryValue. |
| - void GetWindowList(const std::vector<SessionWindow*>& windows, |
| - ListValue* window_list); |
| + void GetWindowList( |
| + const browser_sync::SyncedSession::SyncedWindowMap& windows, |
| + ListValue* window_list); |
| // Appends each entry in |sessions| to |session_list| as a DictonaryValue. |
| void GetSessionList( |
| @@ -156,10 +157,11 @@ void SessionsDOMHandler::GetTabList( |
| } |
| void SessionsDOMHandler::GetWindowList( |
| - const std::vector<SessionWindow*>& windows, ListValue* window_list) { |
| - for (std::vector<SessionWindow*>::const_iterator it = |
| + const browser_sync::SyncedSession::SyncedWindowMap& windows, |
| + ListValue* window_list) { |
| + for (browser_sync::SyncedSession::SyncedWindowMap::const_iterator it = |
| windows.begin(); it != windows.end(); ++it) { |
| - const SessionWindow* window = *it; |
| + const SessionWindow* window = it->second; |
| scoped_ptr<DictionaryValue> window_data(new DictionaryValue()); |
| window_data->SetInteger("id", window->window_id.id()); |
| window_data->SetDouble("timestamp", |
| @@ -190,10 +192,14 @@ void SessionsDOMHandler::GetAllTabs( |
| const std::vector<const browser_sync::SyncedSession*>& sessions, |
| std::vector<SessionTab*>* all_tabs) { |
| for (size_t i = 0; i < sessions.size(); i++) { |
| - const std::vector<SessionWindow*>& windows = sessions[i]->windows; |
| - for (size_t j = 0; j < windows.size(); j++) { |
| - const std::vector<SessionTab*>& tabs = windows[j]->tabs; |
| + const browser_sync::SyncedSession::SyncedWindowMap& windows = |
| + sessions[i]->windows; |
| + browser_sync::SyncedSession::SyncedWindowMap::const_iterator iter = |
|
akalin
2011/09/26 21:57:24
prefer for loop (even though the indentation gets
Nicolas Zea
2011/09/26 22:55:26
Done.
|
| + windows.begin(); |
| + while (iter != windows.end()) { |
| + const std::vector<SessionTab*>& tabs = iter->second->tabs; |
| all_tabs->insert(all_tabs->end(), tabs.begin(), tabs.end()); |
| + ++iter; |
| } |
| } |
| } |