| OLD | NEW |
| 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 Loading... |
| 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 kAdLikelyInjected = 1 << UmaPolicy::AD_LIKELY_INJECTED; |
| 44 const int kAdLikelyReplaced = 1 << UmaPolicy::AD_LIKELY_REPLACED; |
| 43 | 45 |
| 44 } // namespace | 46 } // namespace |
| 45 | 47 |
| 46 // Class constants, also used in testing. -------------------------------------- | 48 // Class constants, also used in testing. -------------------------------------- |
| 47 | 49 |
| 48 const char UmaPolicy::kNumberOfTabs[] = "num_tabs"; | 50 const char UmaPolicy::kNumberOfTabs[] = "num_tabs"; |
| 49 const size_t UmaPolicy::kMaxTabsTracked = 50; | 51 const size_t UmaPolicy::kMaxTabsTracked = 50; |
| 50 | 52 |
| 51 // Setup and shutdown. --------------------------------------------------------- | 53 // Setup and shutdown. --------------------------------------------------------- |
| 52 | 54 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 switch (ad_injection) { | 150 switch (ad_injection) { |
| 149 case Action::INJECTION_NEW_AD: | 151 case Action::INJECTION_NEW_AD: |
| 150 ret_bit |= kAdInjected; | 152 ret_bit |= kAdInjected; |
| 151 break; | 153 break; |
| 152 case Action::INJECTION_REMOVED_AD: | 154 case Action::INJECTION_REMOVED_AD: |
| 153 ret_bit |= kAdRemoved; | 155 ret_bit |= kAdRemoved; |
| 154 break; | 156 break; |
| 155 case Action::INJECTION_REPLACED_AD: | 157 case Action::INJECTION_REPLACED_AD: |
| 156 ret_bit |= kAdReplaced; | 158 ret_bit |= kAdReplaced; |
| 157 break; | 159 break; |
| 160 case Action::INJECTION_LIKELY_NEW_AD: |
| 161 ret_bit |= kAdLikelyInjected; |
| 162 break; |
| 163 case Action::INJECTION_LIKELY_REPLACED_AD: |
| 164 ret_bit |= kAdLikelyReplaced; |
| 165 break; |
| 158 case Action::NO_AD_INJECTION: | 166 case Action::NO_AD_INJECTION: |
| 159 break; | 167 break; |
| 160 case Action::NUM_INJECTION_TYPES: | 168 case Action::NUM_INJECTION_TYPES: |
| 161 NOTREACHED(); | 169 NOTREACHED(); |
| 162 }; | 170 }; |
| 163 | 171 |
| 164 return ret_bit; | 172 return ret_bit; |
| 165 } | 173 } |
| 166 | 174 |
| 167 void UmaPolicy::HistogramOnClose(const std::string& url) { | 175 void UmaPolicy::HistogramOnClose(const std::string& url) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 return "AdReplaced"; | 407 return "AdReplaced"; |
| 400 case NONE: | 408 case NONE: |
| 401 case MAX_STATUS: | 409 case MAX_STATUS: |
| 402 default: | 410 default: |
| 403 NOTREACHED(); | 411 NOTREACHED(); |
| 404 return ""; | 412 return ""; |
| 405 } | 413 } |
| 406 } | 414 } |
| 407 | 415 |
| 408 } // namespace extensions | 416 } // namespace extensions |
| OLD | NEW |