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

Side by Side Diff: chrome/browser/ui/views/first_run_search_engine_view.cc

Issue 9153008: Progressively refacto FirstRun class to first_run namespace(part 4). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/first_run_dialog.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/first_run_search_engine_view.h" 5 #include "chrome/browser/ui/views/first_run_search_engine_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 } // namespace 52 } // namespace
53 53
54 namespace first_run { 54 namespace first_run {
55 55
56 void ShowFirstRunDialog(Profile* profile, 56 void ShowFirstRunDialog(Profile* profile,
57 bool randomize_search_engine_experiment) { 57 bool randomize_search_engine_experiment) {
58 // If the default search is managed via policy, we don't ask the user to 58 // If the default search is managed via policy, we don't ask the user to
59 // choose. 59 // choose.
60 TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(profile); 60 TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(profile);
61 if (!FirstRun::ShouldShowSearchEngineSelector(model)) 61 if (!first_run::ShouldShowSearchEngineSelector(model))
62 return; 62 return;
63 63
64 views::Widget* window = views::Widget::CreateWindow( 64 views::Widget* window = views::Widget::CreateWindow(
65 new FirstRunSearchEngineView( 65 new FirstRunSearchEngineView(
66 profile, randomize_search_engine_experiment)); 66 profile, randomize_search_engine_experiment));
67 window->SetAlwaysOnTop(true); 67 window->SetAlwaysOnTop(true);
68 window->Show(); 68 window->Show();
69 views::AcceleratorHandler accelerator_handler; 69 views::AcceleratorHandler accelerator_handler;
70 MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); 70 MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler);
71 } 71 }
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 } 501 }
502 502
503 void FirstRunSearchEngineView::ChooseSearchEngine(SearchEngineChoice* choice) { 503 void FirstRunSearchEngineView::ChooseSearchEngine(SearchEngineChoice* choice) {
504 user_chosen_engine_ = true; 504 user_chosen_engine_ = true;
505 DCHECK(choice && template_url_service_); 505 DCHECK(choice && template_url_service_);
506 template_url_service_->SetSearchEngineDialogSlot(choice->slot()); 506 template_url_service_->SetSearchEngineDialogSlot(choice->slot());
507 const TemplateURL* default_search = choice->GetSearchEngine(); 507 const TemplateURL* default_search = choice->GetSearchEngine();
508 if (default_search) 508 if (default_search)
509 template_url_service_->SetDefaultSearchProvider(default_search); 509 template_url_service_->SetDefaultSearchProvider(default_search);
510 } 510 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/first_run_dialog.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698