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_
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
> {
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;
45 friend class base::RefCounted
<Webcam
>;
49 DISALLOW_COPY_AND_ASSIGN(Webcam
);
52 class WebcamResource
: public ApiResource
{
54 WebcamResource(const std::string
& owner_extension_id
,
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
;
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_