2015-05-03 12:32:37 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-03-04 19:24:19 -08:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_FileSystemPermissionRequest_h
|
|
|
|
#define mozilla_dom_FileSystemPermissionRequest_h
|
|
|
|
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIRunnable.h"
|
2014-08-01 00:22:20 -07:00
|
|
|
#include "nsIContentPermissionPrompt.h"
|
|
|
|
#include "nsString.h"
|
2014-03-04 19:24:19 -08:00
|
|
|
|
|
|
|
class nsPIDOMWindow;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class FileSystemTaskBase;
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class FileSystemPermissionRequest final
|
2014-03-04 19:24:19 -08:00
|
|
|
: public nsIContentPermissionRequest
|
|
|
|
, public nsIRunnable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Request permission for the given task.
|
|
|
|
static void
|
|
|
|
RequestForTask(FileSystemTaskBase* aTask);
|
|
|
|
|
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
NS_DECL_NSICONTENTPERMISSIONREQUEST
|
|
|
|
NS_DECL_NSIRUNNABLE
|
|
|
|
private:
|
2014-09-01 15:01:37 -07:00
|
|
|
explicit FileSystemPermissionRequest(FileSystemTaskBase* aTask);
|
2014-03-04 19:24:19 -08:00
|
|
|
|
|
|
|
virtual
|
|
|
|
~FileSystemPermissionRequest();
|
|
|
|
|
|
|
|
nsCString mPermissionType;
|
|
|
|
nsCString mPermissionAccess;
|
2015-10-17 22:24:48 -07:00
|
|
|
RefPtr<FileSystemTaskBase> mTask;
|
2014-03-04 19:24:19 -08:00
|
|
|
nsCOMPtr<nsPIDOMWindow> mWindow;
|
|
|
|
nsCOMPtr<nsIPrincipal> mPrincipal;
|
2015-04-13 18:08:00 -07:00
|
|
|
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
2014-03-04 19:24:19 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_FileSystemPermissionRequest_h
|