| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 friend class BrowserContextKeyedAPIFactory<CopresenceService>; | 50 friend class BrowserContextKeyedAPIFactory<CopresenceService>; |
| 51 | 51 |
| 52 // CopresenceClientDelegate overrides: | 52 // CopresenceClientDelegate overrides: |
| 53 virtual void HandleMessages( | 53 virtual void HandleMessages( |
| 54 const std::string& app_id, | 54 const std::string& app_id, |
| 55 const std::string& subscription_id, | 55 const std::string& subscription_id, |
| 56 const std::vector<copresence::Message>& message) OVERRIDE; | 56 const std::vector<copresence::Message>& message) OVERRIDE; |
| 57 virtual net::URLRequestContextGetter* GetRequestContext() const OVERRIDE; | 57 virtual net::URLRequestContextGetter* GetRequestContext() const OVERRIDE; |
| 58 virtual const std::string GetPlatformVersionString() const OVERRIDE; | 58 virtual const copresence::DeviceFingerprint& GetDeviceFingerprint() const |
| 59 OVERRIDE; |
| 60 virtual const std::string& GetAPIKey() const OVERRIDE; |
| 59 virtual copresence::WhispernetClient* GetWhispernetClient() OVERRIDE; | 61 virtual copresence::WhispernetClient* GetWhispernetClient() OVERRIDE; |
| 60 | 62 |
| 61 // BrowserContextKeyedAPI implementation. | 63 // BrowserContextKeyedAPI implementation. |
| 62 static const char* service_name() { return "CopresenceService"; } | 64 static const char* service_name() { return "CopresenceService"; } |
| 63 | 65 |
| 64 bool is_shutting_down_; | 66 bool is_shutting_down_; |
| 65 std::map<std::string, std::string> apps_by_subscription_id_; | 67 std::map<std::string, std::string> apps_by_subscription_id_; |
| 66 | 68 |
| 67 content::BrowserContext* const browser_context_; | 69 content::BrowserContext* const browser_context_; |
| 70 copresence::DeviceFingerprint device_fingerprint_; |
| 71 std::string api_key_; |
| 72 |
| 68 scoped_ptr<copresence::CopresenceClient> client_; | 73 scoped_ptr<copresence::CopresenceClient> client_; |
| 69 scoped_ptr<copresence::WhispernetClient> whispernet_client_; | 74 scoped_ptr<copresence::WhispernetClient> whispernet_client_; |
| 70 | 75 |
| 71 DISALLOW_COPY_AND_ASSIGN(CopresenceService); | 76 DISALLOW_COPY_AND_ASSIGN(CopresenceService); |
| 72 }; | 77 }; |
| 73 | 78 |
| 74 template <> | 79 template <> |
| 75 void BrowserContextKeyedAPIFactory< | 80 void BrowserContextKeyedAPIFactory< |
| 76 CopresenceService>::DeclareFactoryDependencies(); | 81 CopresenceService>::DeclareFactoryDependencies(); |
| 77 | 82 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 DECLARE_EXTENSION_FUNCTION("copresence.setApiKey", COPRESENCE_SETAPIKEY); | 97 DECLARE_EXTENSION_FUNCTION("copresence.setApiKey", COPRESENCE_SETAPIKEY); |
| 93 | 98 |
| 94 protected: | 99 protected: |
| 95 virtual ~CopresenceSetApiKeyFunction() {} | 100 virtual ~CopresenceSetApiKeyFunction() {} |
| 96 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; | 101 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 } // namespace extensions | 104 } // namespace extensions |
| 100 | 105 |
| 101 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ | 106 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_API_H_ |
| OLD | NEW |