| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/safe_browsing/permission_reporter.h" | 5 #include "chrome/browser/safe_browsing/permission_reporter.h" |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 | 8 |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE: | 40 case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE: |
| 41 return PermissionReport::DURABLE_STORAGE; | 41 return PermissionReport::DURABLE_STORAGE; |
| 42 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 42 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
| 43 return PermissionReport::AUDIO_CAPTURE; | 43 return PermissionReport::AUDIO_CAPTURE; |
| 44 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 44 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
| 45 return PermissionReport::VIDEO_CAPTURE; | 45 return PermissionReport::VIDEO_CAPTURE; |
| 46 case CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC: | 46 case CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC: |
| 47 return PermissionReport::BACKGROUND_SYNC; | 47 return PermissionReport::BACKGROUND_SYNC; |
| 48 case CONTENT_SETTINGS_TYPE_PLUGINS: | 48 case CONTENT_SETTINGS_TYPE_PLUGINS: |
| 49 return PermissionReport::FLASH; | 49 return PermissionReport::FLASH; |
| 50 case CONTENT_SETTINGS_TYPE_SENSORS: |
| 51 // TODO(riju): as of now nothing |
| 50 default: | 52 default: |
| 51 break; | 53 break; |
| 52 } | 54 } |
| 53 | 55 |
| 54 NOTREACHED(); | 56 NOTREACHED(); |
| 55 return PermissionReport::UNKNOWN_PERMISSION; | 57 return PermissionReport::UNKNOWN_PERMISSION; |
| 56 } | 58 } |
| 57 | 59 |
| 58 PermissionReport::Action PermissionActionForReport(PermissionAction action) { | 60 PermissionReport::Action PermissionActionForReport(PermissionAction action) { |
| 59 switch (action) { | 61 switch (action) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 219 } |
| 218 if (log.size() < kMaximumReportsPerOriginPerPermissionPerMinute) { | 220 if (log.size() < kMaximumReportsPerOriginPerPermissionPerMinute) { |
| 219 log.push(current_time); | 221 log.push(current_time); |
| 220 return false; | 222 return false; |
| 221 } else { | 223 } else { |
| 222 return true; | 224 return true; |
| 223 } | 225 } |
| 224 } | 226 } |
| 225 | 227 |
| 226 } // namespace safe_browsing | 228 } // namespace safe_browsing |
| OLD | NEW |