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 CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ |
6 #define CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ | 6 #define CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // This class is responsible for communication with our ledger_proxy extension | 31 // This class is responsible for communication with our ledger_proxy extension |
32 // that talks to the whispernet audio library. | 32 // that talks to the whispernet audio library. |
33 class ChromeWhispernetClient : public copresence::WhispernetClient { | 33 class ChromeWhispernetClient : public copresence::WhispernetClient { |
34 public: | 34 public: |
35 // The browser context needs to outlive this class. | 35 // The browser context needs to outlive this class. |
36 explicit ChromeWhispernetClient(content::BrowserContext* browser_context); | 36 explicit ChromeWhispernetClient(content::BrowserContext* browser_context); |
37 virtual ~ChromeWhispernetClient(); | 37 virtual ~ChromeWhispernetClient(); |
38 | 38 |
39 // WhispernetClient overrides: | 39 // WhispernetClient overrides: |
40 virtual void Initialize(const SuccessCallback& init_callback) OVERRIDE; | 40 virtual void Initialize(const SuccessCallback& init_callback) override; |
41 virtual void Shutdown() OVERRIDE; | 41 virtual void Shutdown() override; |
42 | 42 |
43 virtual void EncodeToken(const std::string& token, bool audible) OVERRIDE; | 43 virtual void EncodeToken(const std::string& token, bool audible) override; |
44 virtual void DecodeSamples(const std::string& samples) OVERRIDE; | 44 virtual void DecodeSamples(const std::string& samples) override; |
45 virtual void DetectBroadcast() OVERRIDE; | 45 virtual void DetectBroadcast() override; |
46 | 46 |
47 virtual void RegisterTokensCallback( | 47 virtual void RegisterTokensCallback( |
48 const TokensCallback& tokens_callback) OVERRIDE; | 48 const TokensCallback& tokens_callback) override; |
49 virtual void RegisterSamplesCallback( | 49 virtual void RegisterSamplesCallback( |
50 const SamplesCallback& samples_callback) OVERRIDE; | 50 const SamplesCallback& samples_callback) override; |
51 virtual void RegisterDetectBroadcastCallback( | 51 virtual void RegisterDetectBroadcastCallback( |
52 const SuccessCallback& db_callback) OVERRIDE; | 52 const SuccessCallback& db_callback) override; |
53 | 53 |
54 virtual TokensCallback GetTokensCallback() OVERRIDE; | 54 virtual TokensCallback GetTokensCallback() override; |
55 virtual SamplesCallback GetSamplesCallback() OVERRIDE; | 55 virtual SamplesCallback GetSamplesCallback() override; |
56 virtual SuccessCallback GetDetectBroadcastCallback() OVERRIDE; | 56 virtual SuccessCallback GetDetectBroadcastCallback() override; |
57 virtual SuccessCallback GetInitializedCallback() OVERRIDE; | 57 virtual SuccessCallback GetInitializedCallback() override; |
58 | 58 |
59 static const char kWhispernetProxyExtensionId[]; | 59 static const char kWhispernetProxyExtensionId[]; |
60 | 60 |
61 private: | 61 private: |
62 // Fire an event to initialize whispernet with the given parameters. | 62 // Fire an event to initialize whispernet with the given parameters. |
63 void InitializeWhispernet( | 63 void InitializeWhispernet( |
64 const extensions::api::copresence_private::AudioParameters& params); | 64 const extensions::api::copresence_private::AudioParameters& params); |
65 | 65 |
66 // This gets called twice; once when the proxy extension loads, the second | 66 // This gets called twice; once when the proxy extension loads, the second |
67 // time when we have initialized the proxy extension's encoder and decoder. | 67 // time when we have initialized the proxy extension's encoder and decoder. |
68 void OnExtensionLoaded(bool success); | 68 void OnExtensionLoaded(bool success); |
69 | 69 |
70 content::BrowserContext* browser_context_; | 70 content::BrowserContext* browser_context_; |
71 | 71 |
72 SuccessCallback extension_loaded_callback_; | 72 SuccessCallback extension_loaded_callback_; |
73 SuccessCallback init_callback_; | 73 SuccessCallback init_callback_; |
74 | 74 |
75 TokensCallback tokens_callback_; | 75 TokensCallback tokens_callback_; |
76 SamplesCallback samples_callback_; | 76 SamplesCallback samples_callback_; |
77 SuccessCallback db_callback_; | 77 SuccessCallback db_callback_; |
78 | 78 |
79 bool extension_loaded_; | 79 bool extension_loaded_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(ChromeWhispernetClient); | 81 DISALLOW_COPY_AND_ASSIGN(ChromeWhispernetClient); |
82 }; | 82 }; |
83 | 83 |
84 #endif // CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ | 84 #endif // CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ |
OLD | NEW |