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

Side by Side Diff: chrome/browser/engagement/site_engagement_service.cc

Issue 1388293002: Notify WebContentsObservers of user interactions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits Created 5 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
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/metrics/field_trial.h" 12 #include "base/metrics/field_trial.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_util.h"
14 #include "base/time/clock.h" 15 #include "base/time/clock.h"
15 #include "base/time/default_clock.h" 16 #include "base/time/default_clock.h"
16 #include "base/values.h" 17 #include "base/values.h"
17 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
18 #include "chrome/browser/engagement/site_engagement_helper.h" 19 #include "chrome/browser/engagement/site_engagement_helper.h"
19 #include "chrome/browser/engagement/site_engagement_service_factory.h" 20 #include "chrome/browser/engagement/site_engagement_service_factory.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "components/content_settings/core/browser/host_content_settings_map.h" 22 #include "components/content_settings/core/browser/host_content_settings_map.h"
22 #include "components/content_settings/core/common/content_settings_pattern.h" 23 #include "components/content_settings/core/common/content_settings_pattern.h"
23 #include "components/variations/variations_associated_data.h" 24 #include "components/variations/variations_associated_data.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 int SiteEngagementService::OriginsWithMaxEngagement( 491 int SiteEngagementService::OriginsWithMaxEngagement(
491 std::map<GURL, double>& score_map) { 492 std::map<GURL, double>& score_map) {
492 int total_origins = 0; 493 int total_origins = 0;
493 494
494 for (const auto& value : score_map) 495 for (const auto& value : score_map)
495 if (value.second == SiteEngagementScore::kMaxPoints) 496 if (value.second == SiteEngagementScore::kMaxPoints)
496 ++total_origins; 497 ++total_origins;
497 498
498 return total_origins; 499 return total_origins;
499 } 500 }
OLDNEW
« no previous file with comments | « chrome/browser/engagement/site_engagement_metrics.h ('k') | chrome/browser/engagement/site_engagement_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698