Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / components / copresence / handlers / audio / audio_directive_handler.h
blob91213c917a6e5077ad5fd2e12d113c7206c6a332
1 // Copyright 2014 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.
5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_
8 #include <string>
10 #include "components/audio_modem/public/whispernet_client.h"
12 namespace copresence {
14 class Directive;
16 // The AudioDirectiveHandler handles audio transmit and receive instructions.
17 class AudioDirectiveHandler {
18 public:
19 virtual ~AudioDirectiveHandler() {}
21 // Do not use this class before calling this.
22 virtual void Initialize(audio_modem::WhispernetClient* whispernet_client,
23 const audio_modem::TokensCallback& tokens_cb) = 0;
25 // Adds an instruction to our handler. The instruction will execute and be
26 // removed after the ttl expires.
27 virtual void AddInstruction(const Directive& directive,
28 const std::string& op_id) = 0;
30 // Removes all instructions associated with this operation id.
31 virtual void RemoveInstructions(const std::string& op_id) = 0;
33 // Returns the currently playing token.
34 virtual const std::string PlayingToken(audio_modem::AudioType type) const = 0;
36 // Returns if we have heard the currently playing audio token.
37 virtual bool IsPlayingTokenHeard(audio_modem::AudioType type) const = 0;
40 } // namespace copresence
42 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_