Index: torch_player_service.cc
===================================================================
--- torch_player_service.cc (revision 8340)
+++ torch_player_service.cc (working copy)
@@ -47,7 +47,7 @@
void Service::PlayUrl(const GURL& url, bool open_new_tab)
{
auto item = make_linked_ptr(new UrlItem(url));
- PlayItem(item, 0, open_new_tab);
+ PlayItem(item, open_new_tab);
}
void Service::PlayTorrent(const torrent::Hash& hash,
@@ -55,7 +55,7 @@
bool open_new_tab)
{
auto item = make_linked_ptr(new TorrentItem(hash, inner_path, profile_));
- PlayItem(item, item->GetPlayIndex(), open_new_tab);
+ PlayItem(item, open_new_tab);
}
void Service::StopPlaying(int tab_id)
@@ -200,8 +200,7 @@
chrome::ShowSingletonTabOverwritingNTP(browser, params);
}
-void Service::PlayItem(const linked_ptr<Item>& item,
- size_t play_index, bool open_new_tab)
+void Service::PlayItem(const linked_ptr<Item>& item, bool open_new_tab)
{
if (open_new_tab)
{
@@ -219,10 +218,10 @@
}
else
{
- auto item = *it;
- item->SetPlayIndex(play_index);
- FOR_EACH_OBSERVER(Observer, observers_, OnReopenTab(item->GetTabId()));
- SetTabFocused(*item);
+ auto equal_item = *it;
+ equal_item->SetPlayIndex(item->GetPlayIndex());
+ FOR_EACH_OBSERVER(Observer, observers_, OnReopenTab(equal_item->GetTabId()));
+ SetTabFocused(*equal_item);
}
}
}