| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Protocol buffer for permission reports sent to the Safe Browsing client-side | |
| 6 // detection (CSD) frontends. This should stay in sync with the Safe Browsing | |
| 7 // server-side protocol buffer. | |
| 8 | |
| 9 syntax = "proto2"; | |
| 10 | |
| 11 option optimize_for = LITE_RUNTIME; | |
| 12 | |
| 13 package safe_browsing; | |
| 14 | |
| 15 // A single Permission Report sent to Safe Browsing client-side detection | |
| 16 // frontends. | |
| 17 message PermissionReport { | |
| 18 // The origin (scheme/host/port) of the site requesting the permission. | |
| 19 optional string origin = 1; | |
| 20 | |
| 21 // The permission being requested/acted upon. | |
| 22 optional PermissionType permission = 2; | |
| 23 | |
| 24 // The platform. | |
| 25 optional PlatformType platform_type = 3; | |
| 26 | |
| 27 // Whether the action was after a user gesture. | |
| 28 optional GestureType gesture = 4; | |
| 29 | |
| 30 // The action the user took. Required. | |
| 31 optional Action action = 5; | |
| 32 | |
| 33 // The UI used to complete the action. | |
| 34 optional SourceUI source_ui = 6; | |
| 35 | |
| 36 // The relevant field trials enabled for this report. | |
| 37 repeated FieldTrial field_trials = 7; | |
| 38 | |
| 39 // The number of dismissals on a prompt for this permission and origin prior | |
| 40 // to this report since the user last cleared their history. | |
| 41 optional int32 num_prior_dismissals = 8; | |
| 42 | |
| 43 // The number of ignores of a prompt for this permission and origin prior to | |
| 44 // this report since the user last cleared their history. | |
| 45 optional int32 num_prior_ignores = 9; | |
| 46 | |
| 47 // The persistence decision on a prompt. Only some experimental prompts will | |
| 48 // have this field set. | |
| 49 optional PersistDecision persisted = 10; | |
| 50 | |
| 51 // Platform | |
| 52 enum PlatformType { | |
| 53 PLATFORM_TYPE_UNSPECIFIED = 0; | |
| 54 DESKTOP_PLATFORM = 1; | |
| 55 ANDROID_PLATFORM = 2; | |
| 56 } | |
| 57 | |
| 58 // Whether the action occurred after a user gesture. | |
| 59 enum GestureType { | |
| 60 GESTURE_TYPE_UNSPECIFIED = 0; | |
| 61 GESTURE = 1; | |
| 62 NO_GESTURE = 2; | |
| 63 } | |
| 64 | |
| 65 // User Permission Actions. This enum is intentionally different from | |
| 66 // the one in src/chrome/browser/permissions/permission_uma_util.h | |
| 67 enum Action { | |
| 68 ACTION_UNSPECIFIED = 0; | |
| 69 GRANTED = 1; | |
| 70 DENIED = 2; | |
| 71 DISMISSED = 3; | |
| 72 IGNORED = 4; | |
| 73 REVOKED = 5; | |
| 74 } | |
| 75 | |
| 76 // Places in the UI that a permission change can occur. | |
| 77 enum SourceUI { | |
| 78 SOURCE_UI_UNSPECIFIED = 0; | |
| 79 PROMPT = 1; | |
| 80 OIB = 2; | |
| 81 SITE_SETTINGS = 3; | |
| 82 PAGE_ACTION = 4; | |
| 83 } | |
| 84 | |
| 85 // The various types of permissions. This should stay in sync with the | |
| 86 // corresponding Safe Browsing logs enum. | |
| 87 enum PermissionType { | |
| 88 UNKNOWN_PERMISSION = 0; | |
| 89 MIDI_SYSEX = 1; | |
| 90 PUSH_MESSAGING = 2; | |
| 91 NOTIFICATIONS = 3; | |
| 92 GEOLOCATION = 4; | |
| 93 PROTECTED_MEDIA_IDENTIFIER = 5; | |
| 94 MIDI = 6; | |
| 95 DURABLE_STORAGE = 7; | |
| 96 AUDIO_CAPTURE = 8; | |
| 97 VIDEO_CAPTURE = 9; | |
| 98 BACKGROUND_SYNC = 10; | |
| 99 FLASH = 11; | |
| 100 } | |
| 101 | |
| 102 // Whether the decision on a prompt was persisted. | |
| 103 enum PersistDecision { | |
| 104 PERSIST_DECISION_UNSPECIFIED = 0; | |
| 105 PERSISTED = 1; | |
| 106 NOT_PERSISTED = 2; | |
| 107 } | |
| 108 | |
| 109 // Description of a field trial or experiment that the user is currently | |
| 110 // enrolled in. All metrics reported in this upload can potentially be | |
| 111 // influenced by the field trial. | |
| 112 message FieldTrial { | |
| 113 // The name of the field trial, as a 32-bit identifier. Currently, the | |
| 114 // identifier is a hash of the field trial's name. | |
| 115 optional fixed32 name_id = 1; | |
| 116 | |
| 117 // The user's group within the field trial, as a 32-bit identifier. | |
| 118 // Currently, the identifier is a hash of the group's name. | |
| 119 optional fixed32 group_id = 2; | |
| 120 } | |
| 121 } | |
| OLD | NEW |