assistant_response_observer.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 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. #ifndef ASH_ASSISTANT_MODEL_ASSISTANT_RESPONSE_OBSERVER_H_
  5. #define ASH_ASSISTANT_MODEL_ASSISTANT_RESPONSE_OBSERVER_H_
  6. #include <vector>
  7. #include "base/component_export.h"
  8. #include "base/observer_list_types.h"
  9. #include "chromeos/ash/services/assistant/public/cpp/assistant_service.h"
  10. namespace ash {
  11. class AssistantUiElement;
  12. // A checked observer which receives Assistant response events.
  13. class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantResponseObserver
  14. : public base::CheckedObserver {
  15. public:
  16. using AssistantSuggestion = chromeos::assistant::AssistantSuggestion;
  17. // Invoked when the specified |ui_element| is added to the response.
  18. virtual void OnUiElementAdded(const AssistantUiElement* ui_element) {}
  19. // Invoked when the specified |suggestions| are added to the response.
  20. virtual void OnSuggestionsAdded(
  21. const std::vector<AssistantSuggestion>& suggestions) {}
  22. protected:
  23. AssistantResponseObserver() = default;
  24. ~AssistantResponseObserver() override = default;
  25. };
  26. } // namespace ash
  27. #endif // ASH_ASSISTANT_MODEL_ASSISTANT_RESPONSE_OBSERVER_H_