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

Side by Side Diff: chrome/browser/extensions/activity_log/uma_policy.cc

Issue 270623005: Update ActivityLog detection to use previous values, hrefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/activity_log/uma_policy.h" 5 #include "chrome/browser/extensions/activity_log/uma_policy.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/extensions/activity_log/activity_action_constants.h" 10 #include "chrome/browser/extensions/activity_log/activity_action_constants.h"
(...skipping 22 matching lines...) Expand all
33 const int kCreatedScript = 1 << UmaPolicy::CREATED_SCRIPT; 33 const int kCreatedScript = 1 << UmaPolicy::CREATED_SCRIPT;
34 const int kCreatedIframe = 1 << UmaPolicy::CREATED_IFRAME; 34 const int kCreatedIframe = 1 << UmaPolicy::CREATED_IFRAME;
35 const int kCreatedDiv = 1 << UmaPolicy::CREATED_DIV; 35 const int kCreatedDiv = 1 << UmaPolicy::CREATED_DIV;
36 const int kCreatedLink = 1 << UmaPolicy::CREATED_LINK; 36 const int kCreatedLink = 1 << UmaPolicy::CREATED_LINK;
37 const int kCreatedInput = 1 << UmaPolicy::CREATED_INPUT; 37 const int kCreatedInput = 1 << UmaPolicy::CREATED_INPUT;
38 const int kCreatedEmbed = 1 << UmaPolicy::CREATED_EMBED; 38 const int kCreatedEmbed = 1 << UmaPolicy::CREATED_EMBED;
39 const int kCreatedObject = 1 << UmaPolicy::CREATED_OBJECT; 39 const int kCreatedObject = 1 << UmaPolicy::CREATED_OBJECT;
40 const int kAdInjected = 1 << UmaPolicy::AD_INJECTED; 40 const int kAdInjected = 1 << UmaPolicy::AD_INJECTED;
41 const int kAdRemoved = 1 << UmaPolicy::AD_REMOVED; 41 const int kAdRemoved = 1 << UmaPolicy::AD_REMOVED;
42 const int kAdReplaced = 1 << UmaPolicy::AD_REPLACED; 42 const int kAdReplaced = 1 << UmaPolicy::AD_REPLACED;
43 const int kAdLikelyReplaced = 1 << UmaPolicy::AD_LIKELY_REPLACED;
43 44
44 } // namespace 45 } // namespace
45 46
46 // Class constants, also used in testing. -------------------------------------- 47 // Class constants, also used in testing. --------------------------------------
47 48
48 const char UmaPolicy::kNumberOfTabs[] = "num_tabs"; 49 const char UmaPolicy::kNumberOfTabs[] = "num_tabs";
49 const size_t UmaPolicy::kMaxTabsTracked = 50; 50 const size_t UmaPolicy::kMaxTabsTracked = 50;
50 51
51 // Setup and shutdown. --------------------------------------------------------- 52 // Setup and shutdown. ---------------------------------------------------------
52 53
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 switch (ad_injection) { 149 switch (ad_injection) {
149 case Action::INJECTION_NEW_AD: 150 case Action::INJECTION_NEW_AD:
150 ret_bit |= kAdInjected; 151 ret_bit |= kAdInjected;
151 break; 152 break;
152 case Action::INJECTION_REMOVED_AD: 153 case Action::INJECTION_REMOVED_AD:
153 ret_bit |= kAdRemoved; 154 ret_bit |= kAdRemoved;
154 break; 155 break;
155 case Action::INJECTION_REPLACED_AD: 156 case Action::INJECTION_REPLACED_AD:
156 ret_bit |= kAdReplaced; 157 ret_bit |= kAdReplaced;
157 break; 158 break;
159 case Action::INJECTION_LIKELY_REPLACED_AD:
160 ret_bit |= kAdLikelyReplaced;
161 break;
158 case Action::NO_AD_INJECTION: 162 case Action::NO_AD_INJECTION:
159 break; 163 break;
160 case Action::NUM_INJECTION_TYPES: 164 case Action::NUM_INJECTION_TYPES:
161 NOTREACHED(); 165 NOTREACHED();
162 }; 166 };
163 167
164 return ret_bit; 168 return ret_bit;
165 } 169 }
166 170
167 void UmaPolicy::HistogramOnClose(const std::string& url) { 171 void UmaPolicy::HistogramOnClose(const std::string& url) {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 return "AdReplaced"; 403 return "AdReplaced";
400 case NONE: 404 case NONE:
401 case MAX_STATUS: 405 case MAX_STATUS:
402 default: 406 default:
403 NOTREACHED(); 407 NOTREACHED();
404 return ""; 408 return "";
405 } 409 }
406 } 410 }
407 411
408 } // namespace extensions 412 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698