Rushan Suleymanov | 4f66fa0 | 2020-01-21 14:12:30 | [diff] [blame] | 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 | |
| 5 | #ifndef CHROME_BROWSER_SHARING_SHARING_MESSAGE_BRIDGE_H_ |
| 6 | #define CHROME_BROWSER_SHARING_SHARING_MESSAGE_BRIDGE_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | |
Rushan Suleymanov | b32520d | 2020-01-23 11:35:12 | [diff] [blame^] | 10 | #include "base/memory/weak_ptr.h" |
| 11 | #include "components/keyed_service/core/keyed_service.h" |
Rushan Suleymanov | 4f66fa0 | 2020-01-21 14:12:30 | [diff] [blame] | 12 | #include "components/sync/protocol/sharing_message_specifics.pb.h" |
| 13 | |
Rushan Suleymanov | b32520d | 2020-01-23 11:35:12 | [diff] [blame^] | 14 | namespace syncer { |
| 15 | class ModelTypeControllerDelegate; |
| 16 | } // namespace syncer |
| 17 | |
Rushan Suleymanov | 4f66fa0 | 2020-01-21 14:12:30 | [diff] [blame] | 18 | // Class to provide an interface to send sharing messages using Sync. |
Rushan Suleymanov | b32520d | 2020-01-23 11:35:12 | [diff] [blame^] | 19 | class SharingMessageBridge : public KeyedService { |
Rushan Suleymanov | 4f66fa0 | 2020-01-21 14:12:30 | [diff] [blame] | 20 | public: |
| 21 | // TODO(crbug.com/1034930): take callbacks once commit error propagation back |
| 22 | // to the bridge is implemented. |
| 23 | virtual void SendSharingMessage( |
| 24 | std::unique_ptr<sync_pb::SharingMessageSpecifics> specifics) = 0; |
| 25 | |
Rushan Suleymanov | b32520d | 2020-01-23 11:35:12 | [diff] [blame^] | 26 | // Returns the delegate for the controller, i.e. sync integration point. |
| 27 | virtual base::WeakPtr<syncer::ModelTypeControllerDelegate> |
| 28 | GetControllerDelegate() = 0; |
Rushan Suleymanov | 4f66fa0 | 2020-01-21 14:12:30 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | #endif // CHROME_BROWSER_SHARING_SHARING_MESSAGE_BRIDGE_H_ |