blob: 26495fac4a9324558d23527413c49fa164663443 [file] [log] [blame]
// Copyright 2019 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.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.chrome.browser.autofill_assistant.proto";
option java_multiple_files = true;
package autofill_assistant;
import "model.proto";
message InteractionsProto {
repeated InteractionProto interactions = 1;
}
message InteractionProto {
// Functions to call each time the event happens, in the specified order.
repeated CallbackProto callbacks = 1;
// The trigger event for |callbacks|.
optional EventProto trigger_event = 2;
}
// Each callback takes a single |ValueProto| as input. Some callbacks only
// support values of particular types.
message CallbackProto {
oneof kind { SetModelValueCallbackProto set_value = 1; }
}
message EventProto {
oneof kind {
OnModelValueChangedEventProto on_value_changed = 1;
OnViewClickedEventProto on_view_clicked = 2;
}
}
// Event that is triggered whenever |model_identifier| changes.
message OnModelValueChangedEventProto {
// The identifier of the value to observe.
optional string model_identifier = 1;
}
// Event that is triggered whenever |view_identifier| is clicked.
message OnViewClickedEventProto {
// The identifier of the view to observe.
optional string view_identifier = 1;
// Optional, the value to send to the callback.
optional ValueProto value = 2;
}
// Callback that writes the incoming value to |model_identifier|.
message SetModelValueCallbackProto {
// The identifier of the value to change.
optional string model_identifier = 1;
}
// Callback that expects a boolean input value and enables/disables the
// specified view.
message SetViewEnabledCallbackProto {
// The identifier of the view to enable/disable.
optional string view_identifier = 1;
}