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

Side by Side Diff: chrome/browser/first_run/first_run.cc

Issue 8393025: Enable search engine dialog for all locales. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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/first_run/first_run.h ('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/first_run/first_run.h" 5 #include "chrome/browser/first_run/first_run.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 if (!local_state->FindPreference( 442 if (!local_state->FindPreference(
443 prefs::kAutofillPersonalDataManagerFirstRun)) { 443 prefs::kAutofillPersonalDataManagerFirstRun)) {
444 local_state->RegisterBooleanPref( 444 local_state->RegisterBooleanPref(
445 prefs::kAutofillPersonalDataManagerFirstRun, false); 445 prefs::kAutofillPersonalDataManagerFirstRun, false);
446 local_state->SetBoolean(prefs::kAutofillPersonalDataManagerFirstRun, true); 446 local_state->SetBoolean(prefs::kAutofillPersonalDataManagerFirstRun, true);
447 } 447 }
448 return true; 448 return true;
449 } 449 }
450 450
451 // static 451 // static
452 bool FirstRun::SearchEngineSelectorDisallowed() {
453 #if defined(GOOGLE_CHROME_BUILD)
454 // For now, the only case in which the search engine dialog should never be
455 // shown is if the locale is Russia.
456 std::string locale = g_browser_process->GetApplicationLocale();
457 return (locale == "ru");
458 #else
459 return false;
460 #endif
461 }
462
463 // static
464 bool FirstRun::ShouldShowSearchEngineSelector(const TemplateURLService* model) { 452 bool FirstRun::ShouldShowSearchEngineSelector(const TemplateURLService* model) {
465 return !SearchEngineSelectorDisallowed() && 453 return model && !model->is_default_search_managed();
466 model && !model->is_default_search_managed();
467 } 454 }
468 455
469 // static 456 // static
470 bool FirstRun::SetOEMFirstRunBubblePref() { 457 bool FirstRun::SetOEMFirstRunBubblePref() {
471 PrefService* local_state = g_browser_process->local_state(); 458 PrefService* local_state = g_browser_process->local_state();
472 if (!local_state) 459 if (!local_state)
473 return false; 460 return false;
474 if (!local_state->FindPreference(prefs::kShouldUseOEMFirstRunBubble)) { 461 if (!local_state->FindPreference(prefs::kShouldUseOEMFirstRunBubble)) {
475 local_state->RegisterBooleanPref(prefs::kShouldUseOEMFirstRunBubble, false); 462 local_state->RegisterBooleanPref(prefs::kShouldUseOEMFirstRunBubble, false);
476 local_state->SetBoolean(prefs::kShouldUseOEMFirstRunBubble, true); 463 local_state->SetBoolean(prefs::kShouldUseOEMFirstRunBubble, true);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 if (!observer->ended()) { 728 if (!observer->ended()) {
742 observer->set_should_quit_message_loop(); 729 observer->set_should_quit_message_loop();
743 MessageLoop::current()->Run(); 730 MessageLoop::current()->Run();
744 } 731 }
745 732
746 // Unfortunately there's no success/fail signal in ImporterHost. 733 // Unfortunately there's no success/fail signal in ImporterHost.
747 return true; 734 return true;
748 } 735 }
749 736
750 #endif // OS_POSIX 737 #endif // OS_POSIX
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698