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

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

Issue 2846038: Add UMA logging of search engine selection position when the search engine lo... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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/views/first_run_search_engine_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/first_run_search_engine_view.cc
===================================================================
--- chrome/browser/views/first_run_search_engine_view.cc (revision 50982)
+++ chrome/browser/views/first_run_search_engine_view.cc (working copy)
@@ -184,8 +184,10 @@
void FirstRunSearchEngineView::ButtonPressed(views::Button* sender,
const views::Event& event) {
- observer_->SearchEngineChosen(
- static_cast<SearchEngineChoice*>(sender)->GetSearchEngine());
+ SearchEngineChoice* choice = static_cast<SearchEngineChoice*>(sender);
+ profile_->GetTemplateURLModel()->SetSearchEngineDialogSlot(
+ choice->slot());
+ observer_->SearchEngineChosen(choice->GetSearchEngine());
}
void FirstRunSearchEngineView::OnTemplateURLModelChanged() {
@@ -257,6 +259,14 @@
srand(seed);
std::random_shuffle(search_engine_choices_.begin(),
search_engine_choices_.end());
+ // Assign to each choice the position in which it is shown on the screen.
+ std::vector<SearchEngineChoice*>::iterator it;
+ int slot = 0;
+ for (it = search_engine_choices_.begin();
+ it != search_engine_choices_.end();
+ it++) {
+ (*it)->set_slot(slot++);
+ }
}
// Now that we know how many logos to show, lay out and become visible.
« no previous file with comments | « chrome/browser/views/first_run_search_engine_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698