Add ICU message format support
[chromium-blink-merge.git] / extensions / browser / api / webcam_private / webcam.h
blob86cadd69f38271030adb0b0978b22934860bf9ac
1 // Copyright 2015 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.
5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_WEBCAM_H_
6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_WEBCAM_H_
8 #include <set>
9 #include <string>
11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h"
13 #include "content/public/browser/browser_thread.h"
14 #include "extensions/browser/api/api_resource.h"
16 namespace extensions {
18 class Webcam : public base::RefCounted<Webcam> {
19 public:
20 enum PanDirection {
21 PAN_LEFT,
22 PAN_RIGHT,
23 PAN_STOP,
26 enum TiltDirection {
27 TILT_UP,
28 TILT_DOWN,
29 TILT_STOP,
32 Webcam();
34 virtual void Reset(bool pan, bool tilt, bool zoom) = 0;
35 virtual bool GetPan(int* value) = 0;
36 virtual bool GetTilt(int* value) = 0;
37 virtual bool GetZoom(int* value) = 0;
38 virtual bool SetPan(int value) = 0;
39 virtual bool SetTilt(int value) = 0;
40 virtual bool SetZoom(int value) = 0;
41 virtual bool SetPanDirection(PanDirection direction) = 0;
42 virtual bool SetTiltDirection(TiltDirection direction) = 0;
44 protected:
45 friend class base::RefCounted<Webcam>;
46 virtual ~Webcam();
48 private:
49 DISALLOW_COPY_AND_ASSIGN(Webcam);
52 class WebcamResource : public ApiResource {
53 public:
54 WebcamResource(const std::string& owner_extension_id,
55 Webcam* webcam,
56 const std::string& webcam_id);
57 ~WebcamResource() override;
59 static const content::BrowserThread::ID kThreadId =
60 content::BrowserThread::UI;
62 Webcam* GetWebcam() const;
63 const std::string GetWebcamId() const;
65 // ApiResource overrides.
66 bool IsPersistent() const override;
68 private:
69 scoped_refptr<Webcam> webcam_;
70 std::string webcam_id_;
72 DISALLOW_COPY_AND_ASSIGN(WebcamResource);
75 } // namespace extensions
77 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_WEBCAM_H_