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. 4 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_PRIVATE_COPRESENCE_PRIVATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_PRIVATE_COPRESENCE_PRIVATE_API_H_ 7 8 #include "chrome/browser/extensions/chrome_extension_function.h" 9 10 namespace copresence { 11 class WhispernetClient; 12 } 13 14 namespace extensions { 15 16 class CopresencePrivateFunction : public ChromeUIThreadExtensionFunction { 17 protected: 18 copresence::WhispernetClient* GetWhispernetClient(); ~CopresencePrivateFunction()19 virtual ~CopresencePrivateFunction() {} 20 }; 21 22 class CopresencePrivateSendFoundFunction : public CopresencePrivateFunction { 23 public: 24 DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendFound", 25 COPRESENCEPRIVATE_SENDFOUND); 26 27 protected: ~CopresencePrivateSendFoundFunction()28 virtual ~CopresencePrivateSendFoundFunction() {} 29 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; 30 }; 31 32 class CopresencePrivateSendSamplesFunction : public CopresencePrivateFunction { 33 public: 34 DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendSamples", 35 COPRESENCEPRIVATE_SENDSAMPLES); 36 37 protected: ~CopresencePrivateSendSamplesFunction()38 virtual ~CopresencePrivateSendSamplesFunction() {} 39 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; 40 }; 41 42 class CopresencePrivateSendDetectFunction : public CopresencePrivateFunction { 43 public: 44 DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendDetect", 45 COPRESENCEPRIVATE_SENDDETECT); 46 47 protected: ~CopresencePrivateSendDetectFunction()48 virtual ~CopresencePrivateSendDetectFunction() {} 49 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; 50 }; 51 52 class CopresencePrivateSendInitializedFunction 53 : public CopresencePrivateFunction { 54 public: 55 DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendInitialized", 56 COPRESENCEPRIVATE_SENDINITIALIZED); 57 58 protected: ~CopresencePrivateSendInitializedFunction()59 virtual ~CopresencePrivateSendInitializedFunction() {} 60 virtual ExtensionFunction::ResponseAction Run() OVERRIDE; 61 }; 62 63 } // namespace extensions 64 65 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_PRIVATE_COPRESENCE_PRIVATE_API_H_ 66