dom/camera/CameraControlListener.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef DOM_CAMERA_CAMERACONTROLLISTENER_H
     6 #define DOM_CAMERA_CAMERACONTROLLISTENER_H
     8 #include <stdint.h>
     9 #include "ICameraControl.h"
    11 namespace mozilla {
    13 namespace layers {
    14   class Image;
    15 }
    17 class CameraControlListener
    18 {
    19 public:
    20   CameraControlListener()
    21   {
    22     MOZ_COUNT_CTOR(CameraControlListener);
    23   }
    25 protected:
    26   // Protected destructor, to discourage deletion outside of Release():
    27   virtual ~CameraControlListener()
    28   {
    29     MOZ_COUNT_DTOR(CameraControlListener);
    30   }
    32 public:
    33   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CameraControlListener);
    35   enum HardwareState
    36   {
    37     kHardwareOpen,
    38     kHardwareClosed
    39   };
    40   virtual void OnHardwareStateChange(HardwareState aState) { }
    42   enum PreviewState
    43   {
    44     kPreviewStopped,
    45     kPreviewPaused,
    46     kPreviewStarted
    47   };
    48   virtual void OnPreviewStateChange(PreviewState aState) { }
    50   enum RecorderState
    51   {
    52     kRecorderStopped,
    53     kRecorderStarted,
    54 #ifdef MOZ_B2G_CAMERA
    55     kFileSizeLimitReached,
    56     kVideoLengthLimitReached,
    57     kTrackCompleted,
    58     kTrackFailed,
    59     kMediaRecorderFailed,
    60     kMediaServerFailed
    61 #endif
    62   };
    63   enum { kNoTrackNumber = -1 };
    64   virtual void OnRecorderStateChange(RecorderState aState, int32_t aStatus, int32_t aTrackNum) { }
    66   virtual void OnShutter() { }
    67   virtual bool OnNewPreviewFrame(layers::Image* aFrame, uint32_t aWidth, uint32_t aHeight)
    68   {
    69     return false;
    70   }
    72   class CameraListenerConfiguration : public ICameraControl::Configuration
    73   {
    74   public:
    75     uint32_t mMaxMeteringAreas;
    76     uint32_t mMaxFocusAreas;
    77   };
    78   virtual void OnConfigurationChange(const CameraListenerConfiguration& aConfiguration) { }
    80   virtual void OnAutoFocusComplete(bool aAutoFocusSucceeded) { }
    81   virtual void OnAutoFocusMoving(bool aIsMoving) { }
    82   virtual void OnTakePictureComplete(uint8_t* aData, uint32_t aLength, const nsAString& aMimeType) { }
    83   virtual void OnFacesDetected(const nsTArray<ICameraControl::Face>& aFaces) { }
    85   enum CameraErrorContext
    86   {
    87     kInStartCamera,
    88     kInStopCamera,
    89     kInAutoFocus,
    90     kInStartFaceDetection,
    91     kInStopFaceDetection,
    92     kInTakePicture,
    93     kInStartRecording,
    94     kInStopRecording,
    95     kInSetConfiguration,
    96     kInStartPreview,
    97     kInStopPreview,
    98     kInResumeContinuousFocus,
    99     kInUnspecified
   100   };
   101   enum CameraError
   102   {
   103     kErrorApiFailed,
   104     kErrorInitFailed,
   105     kErrorInvalidConfiguration,
   106     kErrorServiceFailed,
   107     kErrorSetPictureSizeFailed,
   108     kErrorSetThumbnailSizeFailed,
   109     kErrorUnknown
   110   };
   111   virtual void OnError(CameraErrorContext aContext, CameraError aError) { }
   112 };
   114 } // namespace mozilla
   116 #endif // DOM_CAMERA_CAMERACONTROLLISTENER_H

mercurial