summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/copresence_private/copresence_private_api.h
blob: 360734d2d7de02c7a17ea1757c0ef36f85c561ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_PRIVATE_COPRESENCE_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_PRIVATE_COPRESENCE_PRIVATE_API_H_

#include "chrome/browser/extensions/chrome_extension_function.h"

namespace copresence {
class WhispernetClient;
}

namespace extensions {

class CopresencePrivateFunction : public ChromeUIThreadExtensionFunction {
 protected:
  copresence::WhispernetClient* GetWhispernetClient();
  virtual ~CopresencePrivateFunction() {}
};

class CopresencePrivateSendFoundFunction : public CopresencePrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendFound",
                             COPRESENCEPRIVATE_SENDFOUND);

 protected:
  virtual ~CopresencePrivateSendFoundFunction() {}
  virtual ExtensionFunction::ResponseAction Run() override;
};

class CopresencePrivateSendSamplesFunction : public CopresencePrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendSamples",
                             COPRESENCEPRIVATE_SENDSAMPLES);

 protected:
  virtual ~CopresencePrivateSendSamplesFunction() {}
  virtual ExtensionFunction::ResponseAction Run() override;
};

class CopresencePrivateSendDetectFunction : public CopresencePrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendDetect",
                             COPRESENCEPRIVATE_SENDDETECT);

 protected:
  virtual ~CopresencePrivateSendDetectFunction() {}
  virtual ExtensionFunction::ResponseAction Run() override;
};

class CopresencePrivateSendInitializedFunction
    : public CopresencePrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("copresencePrivate.sendInitialized",
                             COPRESENCEPRIVATE_SENDINITIALIZED);

 protected:
  virtual ~CopresencePrivateSendInitializedFunction() {}
  virtual ExtensionFunction::ResponseAction Run() override;
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_PRIVATE_COPRESENCE_PRIVATE_API_H_