data_offer_delegate.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2017 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 COMPONENTS_EXO_DATA_OFFER_DELEGATE_H_
  5. #define COMPONENTS_EXO_DATA_OFFER_DELEGATE_H_
  6. #include <string>
  7. namespace exo {
  8. class DataOffer;
  9. enum class DndAction;
  10. // Handles events on data devices in context-specific ways.
  11. class DataOfferDelegate {
  12. public:
  13. // Called at the top of the data device's destructor, to give observers a
  14. // chance to remove themselves.
  15. virtual void OnDataOfferDestroying(DataOffer* offer) = 0;
  16. // Called when |mime_type| is offered by the client.
  17. virtual void OnOffer(const std::string& mime_type) = 0;
  18. // Called when possible |source_actions| is offered by the client.
  19. virtual void OnSourceActions(
  20. const base::flat_set<DndAction>& source_actions) = 0;
  21. // Called when current |action| is offered by the client.
  22. virtual void OnAction(DndAction action) = 0;
  23. protected:
  24. virtual ~DataOfferDelegate() {}
  25. };
  26. } // namespace exo
  27. #endif // COMPONENTS_EXO_DATA_OFFER_DELEGATE_H_