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