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 "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 PrefService::UNSYNCABLE_PREF); | 69 PrefService::UNSYNCABLE_PREF); |
70 prefs->RegisterBooleanPref(prefs::kInstantEnabled, | 70 prefs->RegisterBooleanPref(prefs::kInstantEnabled, |
71 false, | 71 false, |
72 PrefService::UNSYNCABLE_PREF); | 72 PrefService::UNSYNCABLE_PREF); |
73 prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, | 73 prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, |
74 false, | 74 false, |
75 PrefService::UNSYNCABLE_PREF); | 75 PrefService::UNSYNCABLE_PREF); |
76 prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, | 76 prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, |
77 false, | 77 false, |
78 PrefService::UNSYNCABLE_PREF); | 78 PrefService::UNSYNCABLE_PREF); |
79 prefs->RegisterIntegerPref(prefs::kInstantFieldTrialRandomDraw, | |
80 base::RandInt(0, 9999), | |
81 PrefService::UNSYNCABLE_PREF); | |
82 PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); | 79 PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); |
83 } | 80 } |
84 | 81 |
85 // static | 82 // static |
86 void InstantController::RecordMetrics(Profile* profile) { | 83 void InstantController::RecordMetrics(Profile* profile) { |
87 if (!IsEnabled(profile)) | 84 if (!IsEnabled(profile)) |
88 return; | 85 return; |
89 | 86 |
90 PrefService* service = profile->GetPrefs(); | 87 PrefService* service = profile->GetPrefs(); |
91 if (service) { | 88 if (service) { |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 if (destroy_factory_.empty()) { | 746 if (destroy_factory_.empty()) { |
750 MessageLoop::current()->PostTask( | 747 MessageLoop::current()->PostTask( |
751 FROM_HERE, destroy_factory_.NewRunnableMethod( | 748 FROM_HERE, destroy_factory_.NewRunnableMethod( |
752 &InstantController::DestroyLoaders)); | 749 &InstantController::DestroyLoaders)); |
753 } | 750 } |
754 } | 751 } |
755 | 752 |
756 void InstantController::DestroyLoaders() { | 753 void InstantController::DestroyLoaders() { |
757 loaders_to_destroy_.reset(); | 754 loaders_to_destroy_.reset(); |
758 } | 755 } |
OLD | NEW |