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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 InstantController::~InstantController() { | 79 InstantController::~InstantController() { |
80 } | 80 } |
81 | 81 |
82 // static | 82 // static |
83 void InstantController::RegisterUserPrefs(PrefService* prefs) { | 83 void InstantController::RegisterUserPrefs(PrefService* prefs) { |
84 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, | 84 prefs->RegisterBooleanPref(prefs::kInstantConfirmDialogShown, |
85 false, | 85 false, |
86 PrefService::UNSYNCABLE_PREF); | 86 PrefService::SYNCABLE_PREF); |
87 prefs->RegisterBooleanPref(prefs::kInstantEnabled, | 87 prefs->RegisterBooleanPref(prefs::kInstantEnabled, |
88 false, | 88 false, |
89 PrefService::UNSYNCABLE_PREF); | 89 PrefService::SYNCABLE_PREF); |
90 prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, | 90 prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce, |
91 false, | 91 false, |
92 PrefService::UNSYNCABLE_PREF); | 92 PrefService::SYNCABLE_PREF); |
93 prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, | 93 prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, |
94 false, | 94 false, |
95 PrefService::UNSYNCABLE_PREF); | 95 PrefService::SYNCABLE_PREF); |
Nicolas Zea
2011/09/14 21:32:12
Have you verified that this value is cross-platfor
csharp
2011/09/15 13:39:12
I have not, I had thought that it would be cross-p
Nicolas Zea
2011/09/15 19:48:57
Looking below, it's just a base::Time::Now().ToInt
| |
96 PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); | 96 PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); |
97 } | 97 } |
98 | 98 |
99 // static | 99 // static |
100 void InstantController::RecordMetrics(Profile* profile) { | 100 void InstantController::RecordMetrics(Profile* profile) { |
101 if (!IsEnabled(profile)) | 101 if (!IsEnabled(profile)) |
102 return; | 102 return; |
103 | 103 |
104 PrefService* service = profile->GetPrefs(); | 104 PrefService* service = profile->GetPrefs(); |
105 if (service) { | 105 if (service) { |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
772 if (destroy_factory_.empty()) { | 772 if (destroy_factory_.empty()) { |
773 MessageLoop::current()->PostTask( | 773 MessageLoop::current()->PostTask( |
774 FROM_HERE, destroy_factory_.NewRunnableMethod( | 774 FROM_HERE, destroy_factory_.NewRunnableMethod( |
775 &InstantController::DestroyLoaders)); | 775 &InstantController::DestroyLoaders)); |
776 } | 776 } |
777 } | 777 } |
778 | 778 |
779 void InstantController::DestroyLoaders() { | 779 void InstantController::DestroyLoaders() { |
780 loaders_to_destroy_.reset(); | 780 loaders_to_destroy_.reset(); |
781 } | 781 } |
OLD | NEW |