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

Unified Diff: chrome/browser/ui/tabs/tab_strip_model_utils.cc

Issue 17114002: Field trial removing tiles from NTP if URL is already open - for 1993 clients (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing tests Created 7 years, 5 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
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model_utils.h ('k') | chrome/browser/ui/webui/ntp/most_visited_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ed09b85658dde0e6e330b97716d7913342d35246 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,14 @@ int IndexOfFirstBlockedTab(const TabStripModel* model) {
return model->count();
}
+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
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model_utils.h ('k') | chrome/browser/ui/webui/ntp/most_visited_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698