| OLD | NEW |
| 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/instant/instant_controller.h" | 5 #include "chrome/browser/instant/instant_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // it is correctly set. | 51 // it is correctly set. |
| 52 service->SetBoolean(prefs::kInstantEnabledOnce, true); | 52 service->SetBoolean(prefs::kInstantEnabledOnce, true); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 InstantController::~InstantController() { | 56 InstantController::~InstantController() { |
| 57 } | 57 } |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 void InstantController::RegisterUserPrefs(PrefService* prefs) { | 60 void InstantController::RegisterUserPrefs(PrefService* prefs) { |
| 61 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, false); | 61 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, |
| 62 prefs->RegisterBooleanPref(prefs::kInstantEnabled, false); | 62 false, |
| 63 prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, false); | 63 PrefService::UNSYNCABLE_PREF); |
| 64 prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, false); | 64 prefs->RegisterBooleanPref(prefs::kInstantEnabled, |
| 65 false, |
| 66 PrefService::UNSYNCABLE_PREF); |
| 67 prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, |
| 68 false, |
| 69 PrefService::UNSYNCABLE_PREF); |
| 70 prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, |
| 71 false, |
| 72 PrefService::UNSYNCABLE_PREF); |
| 65 PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); | 73 PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); |
| 66 } | 74 } |
| 67 | 75 |
| 68 // static | 76 // static |
| 69 void InstantController::RecordMetrics(Profile* profile) { | 77 void InstantController::RecordMetrics(Profile* profile) { |
| 70 if (!IsEnabled(profile)) | 78 if (!IsEnabled(profile)) |
| 71 return; | 79 return; |
| 72 | 80 |
| 73 PrefService* service = profile->GetPrefs(); | 81 PrefService* service = profile->GetPrefs(); |
| 74 if (service) { | 82 if (service) { |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 const AutocompleteMatch& match) { | 693 const AutocompleteMatch& match) { |
| 686 const TemplateURL* template_url = match.template_url; | 694 const TemplateURL* template_url = match.template_url; |
| 687 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED || | 695 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED || |
| 688 match.type == AutocompleteMatch::SEARCH_HISTORY || | 696 match.type == AutocompleteMatch::SEARCH_HISTORY || |
| 689 match.type == AutocompleteMatch::SEARCH_SUGGEST) { | 697 match.type == AutocompleteMatch::SEARCH_SUGGEST) { |
| 690 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel(); | 698 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel(); |
| 691 template_url = model ? model->GetDefaultSearchProvider() : NULL; | 699 template_url = model ? model->GetDefaultSearchProvider() : NULL; |
| 692 } | 700 } |
| 693 return template_url; | 701 return template_url; |
| 694 } | 702 } |
| OLD | NEW |