Chromium Code Reviews| Index: chrome/browser/ui/tabs/tab_strip_model_utils.cc |
| diff --git a/chrome/browser/ui/tabs/tab_strip_model_utils.cc b/chrome/browser/ui/tabs/tab_strip_model_utils.cc |
| index 2605dd7532e361f432d4f0e4eb20c5f57b37a003..8017059113c752bd843f9c9353c3d3c7c67bb933 100644 |
| --- a/chrome/browser/ui/tabs/tab_strip_model_utils.cc |
| +++ b/chrome/browser/ui/tabs/tab_strip_model_utils.cc |
| @@ -4,7 +4,9 @@ |
| #include "chrome/browser/ui/tabs/tab_strip_model_utils.h" |
| +#include "chrome/browser/history/top_sites.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| +#include "content/public/browser/web_contents.h" |
| namespace chrome { |
| @@ -18,4 +20,15 @@ int IndexOfFirstBlockedTab(const TabStripModel* model) { |
| return model->count(); |
| } |
| +// Creates a set containing the canonical URLs of the currently open tabs. |
|
Alexei Svitkine (slow)
2013/07/24 18:37:36
No need for a comment here, given that you already
annark1
2013/07/24 20:43:31
Done.
|
| +void GetOpenUrls(const TabStripModel& tabs, |
| + const history::TopSites& top_sites, |
| + std::set<std::string>* urls) { |
| + for (int i = 0; i < tabs.count(); ++i) { |
| + content::WebContents* web_contents = tabs.GetWebContentsAt(i); |
| + if (web_contents) |
| + urls->insert(top_sites.GetCanonicalURLString(web_contents->GetURL())); |
| + } |
| +} |
| + |
| } // namespace chrome |