OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_ | 5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_ |
6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_ | 6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_ |
7 | 7 |
8 #include "components/copresence/handlers/directive_handler.h" | 8 #include "components/copresence/handlers/directive_handler.h" |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 10 matching lines...) Expand all Loading... |
21 class DirectiveHandlerImpl final : public DirectiveHandler { | 21 class DirectiveHandlerImpl final : public DirectiveHandler { |
22 public: | 22 public: |
23 explicit DirectiveHandlerImpl( | 23 explicit DirectiveHandlerImpl( |
24 const DirectivesCallback& update_directives_callback); | 24 const DirectivesCallback& update_directives_callback); |
25 DirectiveHandlerImpl( | 25 DirectiveHandlerImpl( |
26 const DirectivesCallback& update_directives_callback, | 26 const DirectivesCallback& update_directives_callback, |
27 scoped_ptr<AudioDirectiveHandler> audio_handler); | 27 scoped_ptr<AudioDirectiveHandler> audio_handler); |
28 ~DirectiveHandlerImpl() override; | 28 ~DirectiveHandlerImpl() override; |
29 | 29 |
30 // DirectiveHandler overrides. | 30 // DirectiveHandler overrides. |
31 void Start(WhispernetClient* whispernet_client, | 31 void Start(audio_modem::WhispernetClient* whispernet_client, |
32 const TokensCallback& tokens_cb) override; | 32 const audio_modem::TokensCallback& tokens_cb) override; |
33 void AddDirective(const Directive& directive) override; | 33 void AddDirective(const Directive& directive) override; |
34 void RemoveDirectives(const std::string& op_id) override; | 34 void RemoveDirectives(const std::string& op_id) override; |
35 const std::string GetCurrentAudioToken(AudioType type) const override; | 35 const std::string |
36 bool IsAudioTokenHeard(AudioType type) const override; | 36 GetCurrentAudioToken(audio_modem::AudioType type) const override; |
| 37 bool IsAudioTokenHeard(audio_modem::AudioType type) const override; |
37 | 38 |
38 private: | 39 private: |
39 // Starts actually running a directive. | 40 // Starts actually running a directive. |
40 void StartDirective(const std::string& op_id, const Directive& directive); | 41 void StartDirective(const std::string& op_id, const Directive& directive); |
41 | 42 |
42 scoped_ptr<AudioDirectiveHandler> audio_handler_; | 43 scoped_ptr<AudioDirectiveHandler> audio_handler_; |
43 std::map<std::string, std::vector<Directive>> pending_directives_; | 44 std::map<std::string, std::vector<Directive>> pending_directives_; |
44 | 45 |
45 bool is_started_; | 46 bool is_started_; |
46 | 47 |
47 DISALLOW_COPY_AND_ASSIGN(DirectiveHandlerImpl); | 48 DISALLOW_COPY_AND_ASSIGN(DirectiveHandlerImpl); |
48 }; | 49 }; |
49 | 50 |
50 } // namespace copresence | 51 } // namespace copresence |
51 | 52 |
52 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_ | 53 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_ |
OLD | NEW |