blob: 06b9ddbb19be2738e85c821468e391aff3e5f419 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Protocol buffer for permission reports sent to the Safe Browsing client-side
// detection (CSD) frontends. This should stay in sync with the Safe Browsing
// server-side protocol buffer.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package safe_browsing;
// A single Permission Report sent to Safe Browsing client-side detection
// frontends.
message PermissionReport {
// The origin (scheme/host/port) of the site requesting the permission.
optional string origin = 1;
// The permission being requested/acted upon.
optional PermissionType permission = 2;
// The platform.
optional PlatformType platform_type = 3;
// Whether the action was after a user gesture.
optional GestureType gesture = 4;
// The action the user took. Required.
optional Action action = 5;
// The UI used to complete the action.
optional SourceUI source_ui = 6;
// The relevant field trials enabled for this report.
repeated FieldTrial field_trials = 7;
// The number of dismissals on a prompt for this permission and origin prior
// to this report since the user last cleared their history.
optional int32 num_prior_dismissals = 8;
// The number of ignores of a prompt for this permission and origin prior to
// this report since the user last cleared their history.
optional int32 num_prior_ignores = 9;
// The persistence decision on a prompt. Only some experimental prompts will
// have this field set.
optional PersistDecision persisted = 10;
// Platform
enum PlatformType {
PLATFORM_TYPE_UNSPECIFIED = 0;
DESKTOP_PLATFORM = 1;
ANDROID_PLATFORM = 2;
}
// Whether the action occurred after a user gesture.
enum GestureType {
GESTURE_TYPE_UNSPECIFIED = 0;
GESTURE = 1;
NO_GESTURE = 2;
}
// User Permission Actions. This enum is intentionally different from
// the one in src/chrome/browser/permissions/permission_uma_util.h
enum Action {
ACTION_UNSPECIFIED = 0;
GRANTED = 1;
DENIED = 2;
DISMISSED = 3;
IGNORED = 4;
REVOKED = 5;
}
// Places in the UI that a permission change can occur.
enum SourceUI {
SOURCE_UI_UNSPECIFIED = 0;
PROMPT = 1;
OIB = 2;
SITE_SETTINGS = 3;
PAGE_ACTION = 4;
}
// The various types of permissions. This should stay in sync with the
// corresponding Safe Browsing logs enum.
enum PermissionType {
UNKNOWN_PERMISSION = 0;
MIDI_SYSEX = 1;
PUSH_MESSAGING = 2;
NOTIFICATIONS = 3;
GEOLOCATION = 4;
PROTECTED_MEDIA_IDENTIFIER = 5;
MIDI = 6;
DURABLE_STORAGE = 7;
AUDIO_CAPTURE = 8;
VIDEO_CAPTURE = 9;
BACKGROUND_SYNC = 10;
FLASH = 11;
}
// OBSOLETE: Persist toggle experiments ran from M56 to M59.
// Whether the decision on a prompt was persisted.
enum PersistDecision {
PERSIST_DECISION_UNSPECIFIED = 0;
PERSISTED = 1;
NOT_PERSISTED = 2;
}
// Description of a field trial or experiment that the user is currently
// enrolled in. All metrics reported in this upload can potentially be
// influenced by the field trial.
message FieldTrial {
// The name of the field trial, as a 32-bit identifier. Currently, the
// identifier is a hash of the field trial's name.
optional fixed32 name_id = 1;
// The user's group within the field trial, as a 32-bit identifier.
// Currently, the identifier is a hash of the group's name.
optional fixed32 group_id = 2;
}
}