blob: cd8b5445a1226f8a833349646c912cc73597e2db [file] [log] [blame]
Rushan Suleymanov4f66fa02020-01-21 14:12:301// 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 Suleymanovb32520d2020-01-23 11:35:1210#include "base/memory/weak_ptr.h"
11#include "components/keyed_service/core/keyed_service.h"
Rushan Suleymanov4f66fa02020-01-21 14:12:3012#include "components/sync/protocol/sharing_message_specifics.pb.h"
13
Rushan Suleymanovb32520d2020-01-23 11:35:1214namespace syncer {
15class ModelTypeControllerDelegate;
16} // namespace syncer
17
Rushan Suleymanov4f66fa02020-01-21 14:12:3018// Class to provide an interface to send sharing messages using Sync.
Rushan Suleymanovb32520d2020-01-23 11:35:1219class SharingMessageBridge : public KeyedService {
Rushan Suleymanov4f66fa02020-01-21 14:12:3020 public:
21 // TODO(crbug.com/1034930): take callbacks once commit error propagation back
22 // to the bridge is implemented.
Rushan Suleymanov86d179a2020-01-23 12:52:3523 // TODO(crbug.com/1034932): take each parameter separately and construct
24 // specifics inside. Currently this method updates given |specifics| and
25 // fills in |message_id| field.
Rushan Suleymanov4f66fa02020-01-21 14:12:3026 virtual void SendSharingMessage(
27 std::unique_ptr<sync_pb::SharingMessageSpecifics> specifics) = 0;
28
Rushan Suleymanovb32520d2020-01-23 11:35:1229 // Returns the delegate for the controller, i.e. sync integration point.
30 virtual base::WeakPtr<syncer::ModelTypeControllerDelegate>
31 GetControllerDelegate() = 0;
Rushan Suleymanov4f66fa02020-01-21 14:12:3032};
33
34#endif // CHROME_BROWSER_SHARING_SHARING_MESSAGE_BRIDGE_H_