OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/engagement/site_engagement_service.h" | 5 #include "chrome/browser/engagement/site_engagement_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 const std::string group_name = | 103 const std::string group_name = |
104 base::FieldTrialList::FindFullName(kEngagementParams); | 104 base::FieldTrialList::FindFullName(kEngagementParams); |
105 return !base::StartsWith(group_name, "Disabled", | 105 return !base::StartsWith(group_name, "Disabled", |
106 base::CompareCase::SENSITIVE); | 106 base::CompareCase::SENSITIVE); |
107 } | 107 } |
108 | 108 |
109 SiteEngagementService::SiteEngagementService(Profile* profile) | 109 SiteEngagementService::SiteEngagementService(Profile* profile) |
110 : SiteEngagementService(profile, base::WrapUnique(new base::DefaultClock)) { | 110 : SiteEngagementService(profile, base::WrapUnique(new base::DefaultClock)) { |
111 content::BrowserThread::PostAfterStartupTask( | 111 content::BrowserThread::PostAfterStartupTask( |
112 FROM_HERE, content::BrowserThread::GetMessageLoopProxyForThread( | 112 FROM_HERE, content::BrowserThread::GetTaskRunnerForThread( |
113 content::BrowserThread::UI), | 113 content::BrowserThread::UI), |
114 base::Bind(&SiteEngagementService::AfterStartupTask, | 114 base::Bind(&SiteEngagementService::AfterStartupTask, |
115 weak_factory_.GetWeakPtr())); | 115 weak_factory_.GetWeakPtr())); |
116 | 116 |
117 if (!g_updated_from_variations) { | 117 if (!g_updated_from_variations) { |
118 SiteEngagementScore::UpdateFromVariations(kEngagementParams); | 118 SiteEngagementScore::UpdateFromVariations(kEngagementParams); |
119 g_updated_from_variations = true; | 119 g_updated_from_variations = true; |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 if (!engagement_score.last_shortcut_launch_time().is_null() && | 579 if (!engagement_score.last_shortcut_launch_time().is_null() && |
580 engagement_score.last_shortcut_launch_time() > last_visit) { | 580 engagement_score.last_shortcut_launch_time() > last_visit) { |
581 engagement_score.set_last_shortcut_launch_time(last_visit); | 581 engagement_score.set_last_shortcut_launch_time(last_visit); |
582 } | 582 } |
583 | 583 |
584 engagement_score.Commit(); | 584 engagement_score.Commit(); |
585 } | 585 } |
586 | 586 |
587 SetLastEngagementTime(now); | 587 SetLastEngagementTime(now); |
588 } | 588 } |
OLD | NEW |