Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / copresence / handlers / directive_handler.h
blob6221a35154aae73043eb951c82226067de67a16b
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_DIRECTIVE_HANDLER_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_H_
8 #include <string>
10 #include "base/macros.h"
11 #include "components/audio_modem/public/whispernet_client.h"
13 namespace copresence {
15 class Directive;
17 // The directive handler manages transmit and receive directives.
18 class DirectiveHandler {
19 public:
20 DirectiveHandler() {}
21 virtual ~DirectiveHandler() {}
23 // Starts processing directives with the provided Whispernet delegate.
24 // Directives will be queued until this function is called.
25 // |whispernet_client| is owned by the caller and must outlive the
26 // DirectiveHandler.
27 // |tokens_cb| is called for all audio tokens found in recorded audio.
28 // TODO(ckehoe): This is no longer needed. Merge into the constructor.
29 virtual void Start(audio_modem::WhispernetClient* whispernet_client,
30 const audio_modem::TokensCallback& tokens_cb) = 0;
32 // Adds a directive to handle.
33 virtual void AddDirective(const Directive& directive) = 0;
35 // Removes any directives associated with the given operation id.
36 virtual void RemoveDirectives(const std::string& op_id) = 0;
38 // TODO(ckehoe): Move the Modem to be owned by CopresenceManager.
39 // Then this will not need to be passed all the way down the tree.
40 virtual const std::string
41 GetCurrentAudioToken(audio_modem::AudioType type) const = 0;
42 virtual bool IsAudioTokenHeard(audio_modem::AudioType type) const = 0;
44 private:
45 DISALLOW_COPY_AND_ASSIGN(DirectiveHandler);
48 } // namespace copresence
50 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_H_