blob: d801179edbac7f258827aa687e99a08188652d6d [file] [log] [blame]
// Copyright 2018 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.
#ifndef COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_UI_DELEGATE_H_
#define COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_UI_DELEGATE_H_
#include <string>
namespace autofill_assistant {
// UI delegate called for script executions.
class UiDelegate {
public:
virtual ~UiDelegate() = default;
// Called when the overlay has been clicked.
virtual void OnClickOverlay() = 0;
// Asks for updated coordinates for the touchable area. This is called to
// speed up update of the touchable areas when there are good reasons to think
// that the current coordinates are out of date, such as while scrolling.
virtual void UpdateTouchableArea() = 0;
// Called when user interaction within the allowed touchable area was
// detected. This should cause rerun of preconditions check.
virtual void OnUserInteractionInsideTouchableArea() = 0;
// Called when a script was selected for execution.
virtual void OnScriptSelected(const std::string& script_path) = 0;
// Returns a string describing the current execution context. This is useful
// when analyzing feedback forms and for debugging in general.
virtual std::string GetDebugContext() = 0;
protected:
UiDelegate() = default;
};
} // namespace autofill_assistant
#endif // COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_UI_DELEGATE_H_