| 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_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 explicit CopresenceService(content::BrowserContext* context); | 43 explicit CopresenceService(content::BrowserContext* context); |
| 44 ~CopresenceService() override; | 44 ~CopresenceService() override; |
| 45 | 45 |
| 46 // BrowserContextKeyedAPI implementation. | 46 // BrowserContextKeyedAPI implementation. |
| 47 static const bool kServiceHasOwnInstanceInIncognito = true; | 47 static const bool kServiceHasOwnInstanceInIncognito = true; |
| 48 void Shutdown() override; | 48 void Shutdown() override; |
| 49 | 49 |
| 50 // These accessors will always return an object (except during shutdown). | 50 // These accessors will always return an object (except during shutdown). |
| 51 // If the object doesn't exist, they will create one first. | 51 // If the object doesn't exist, they will create one first. |
| 52 copresence::CopresenceManager* manager(); | 52 copresence::CopresenceManager* manager(); |
| 53 // TODO(ckehoe): Merge this with GetWhispernetClient() below. | |
| 54 audio_modem::WhispernetClient* whispernet_client(); | |
| 55 | 53 |
| 56 // A registry containing the app id's associated with every subscription. | 54 // A registry containing the app id's associated with every subscription. |
| 57 SubscriptionToAppMap& apps_by_subscription_id() { | 55 SubscriptionToAppMap& apps_by_subscription_id() { |
| 58 return apps_by_subscription_id_; | 56 return apps_by_subscription_id_; |
| 59 } | 57 } |
| 60 | 58 |
| 61 const std::string auth_token(const std::string& app_id) const; | 59 const std::string auth_token(const std::string& app_id) const; |
| 62 | 60 |
| 63 void set_api_key(const std::string& app_id, | 61 void set_api_key(const std::string& app_id, |
| 64 const std::string& api_key); | 62 const std::string& api_key); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 COPRESENCE_SETAUTHTOKEN); | 144 COPRESENCE_SETAUTHTOKEN); |
| 147 | 145 |
| 148 protected: | 146 protected: |
| 149 ~CopresenceSetAuthTokenFunction() override {} | 147 ~CopresenceSetAuthTokenFunction() override {} |
| 150 ExtensionFunction::ResponseAction Run() override; | 148 ExtensionFunction::ResponseAction Run() override; |
| 151 }; | 149 }; |
| 152 | 150 |
| 153 } // namespace extensions | 151 } // namespace extensions |
| 154 | 152 |
| 155 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ | 153 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ |
| OLD | NEW |