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

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

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: rebased Created 3 years, 5 months 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // Fetch URLs of sites with engagement details stored. 69 // Fetch URLs of sites with engagement details stored.
70 for (const auto& site : GetContentSettingsFromProfile( 70 for (const auto& site : GetContentSettingsFromProfile(
71 profile, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT)) { 71 profile, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT)) {
72 urls.insert(GURL(site.primary_pattern.ToString())); 72 urls.insert(GURL(site.primary_pattern.ToString()));
73 } 73 }
74 74
75 // Fetch URLs of sites for which notifications are allowed. 75 // Fetch URLs of sites for which notifications are allowed.
76 for (const auto& site : GetContentSettingsFromProfile( 76 for (const auto& site : GetContentSettingsFromProfile(
77 profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)) { 77 profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)) {
78 if (site.setting != CONTENT_SETTING_ALLOW) 78 if (site.GetContentSetting() != CONTENT_SETTING_ALLOW)
79 continue; 79 continue;
80 urls.insert(GURL(site.primary_pattern.ToString())); 80 urls.insert(GURL(site.primary_pattern.ToString()));
81 } 81 }
82 82
83 return urls; 83 return urls;
84 } 84 }
85 85
86 // Only accept a navigation event for engagement if it is one of: 86 // Only accept a navigation event for engagement if it is one of:
87 // a. direct typed navigation 87 // a. direct typed navigation
88 // b. clicking on an omnibox suggestion brought up by typing a keyword 88 // b. clicking on an omnibox suggestion brought up by typing a keyword
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 if (!engagement_score.last_shortcut_launch_time().is_null() && 701 if (!engagement_score.last_shortcut_launch_time().is_null() &&
702 engagement_score.last_shortcut_launch_time() > last_visit) { 702 engagement_score.last_shortcut_launch_time() > last_visit) {
703 engagement_score.set_last_shortcut_launch_time(last_visit); 703 engagement_score.set_last_shortcut_launch_time(last_visit);
704 } 704 }
705 705
706 engagement_score.Commit(); 706 engagement_score.Commit();
707 } 707 }
708 708
709 SetLastEngagementTime(now); 709 SetLastEngagementTime(now);
710 } 710 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698