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

Unified Diff: chrome/browser/views/first_run_search_engine_view.cc

Issue 3053050: Add RandomNumberGenerator adapter to base/rand_util.h (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Compile on Windows, too... Created 10 years, 4 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
Index: chrome/browser/views/first_run_search_engine_view.cc
diff --git a/chrome/browser/views/first_run_search_engine_view.cc b/chrome/browser/views/first_run_search_engine_view.cc
index 30947dbb5e18f99e1c89be90eeb4b4535e5a65c1..087e7ea8de317a86445c4bdac86e27a1d58f3c91 100644
--- a/chrome/browser/views/first_run_search_engine_view.cc
+++ b/chrome/browser/views/first_run_search_engine_view.cc
@@ -6,10 +6,12 @@
#include <algorithm>
#include <map>
+#include <vector>
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/i18n/rtl.h"
+#include "base/rand_util.h"
#include "base/time.h"
#include "chrome/browser/options_window.h"
#include "chrome/browser/profile.h"
@@ -210,10 +212,9 @@ void FirstRunSearchEngineView::OnTemplateURLModelChanged() {
// Randomize order of logos if option has been set.
if (randomize_) {
- int seed = static_cast<int>(Time::Now().ToInternalValue());
- srand(seed);
std::random_shuffle(search_engine_choices_.begin(),
- search_engine_choices_.end());
+ search_engine_choices_.end(),
+ base::RandGenerator);
// Assign to each choice the position in which it is shown on the screen.
std::vector<SearchEngineChoice*>::iterator it;
int slot = 0;

Powered by Google App Engine
This is Rietveld 408576698