• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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.
4 
5 #ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H
6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H
7 
8 #include "android_webview/native/permission/aw_permission_request_delegate.h"
9 #include "base/callback.h"
10 
11 namespace android_webview {
12 
13 // The class is used to handle the simple permission request which just needs
14 // a callback with bool parameter to indicate the permission granted or not.
15 class SimplePermissionRequest : public AwPermissionRequestDelegate {
16  public:
17   SimplePermissionRequest(const GURL& origin,
18                           int64 resources,
19                           const base::Callback<void(bool)>& callback);
20   virtual ~SimplePermissionRequest();
21 
22   // AwPermissionRequestDelegate implementation.
23   virtual const GURL& GetOrigin() OVERRIDE;
24   virtual int64 GetResources() OVERRIDE;
25   virtual void NotifyRequestResult(bool allowed) OVERRIDE;
26 
27  private:
28   const GURL origin_;
29   int64 resources_;
30   const base::Callback<void(bool)> callback_;
31 
32   DISALLOW_COPY_AND_ASSIGN(SimplePermissionRequest);
33 };
34 
35 }  // namespace android_webview
36 
37 #endif  // ANDROID_WEBVIEW_NATIVE_PERMISSION_PROTECTED_MEDIA_ID_PERMISSION_REQUEST_H
38