OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H | 5 #ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H |
6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H | 6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_SIMPLE_PERMISSION_REQUEST_H |
7 | 7 |
8 #include "android_webview/native/permission/aw_permission_request_delegate.h" | 8 #include "android_webview/native/permission/aw_permission_request_delegate.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 | 10 |
11 namespace android_webview { | 11 namespace android_webview { |
12 | 12 |
13 // The class is used to handle the simple permission request which just needs | 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. | 14 // a callback with bool parameter to indicate the permission granted or not. |
15 class SimplePermissionRequest : public AwPermissionRequestDelegate { | 15 class SimplePermissionRequest : public AwPermissionRequestDelegate { |
16 public: | 16 public: |
17 SimplePermissionRequest(const GURL& origin, | 17 SimplePermissionRequest(const GURL& origin, |
18 int64 resources, | 18 int64 resources, |
19 const base::Callback<void(bool)>& callback); | 19 const base::Callback<void(bool)>& callback); |
20 virtual ~SimplePermissionRequest(); | 20 virtual ~SimplePermissionRequest(); |
21 | 21 |
22 // AwPermissionRequestDelegate implementation. | 22 // AwPermissionRequestDelegate implementation. |
23 virtual const GURL& GetOrigin() OVERRIDE; | 23 virtual const GURL& GetOrigin() override; |
24 virtual int64 GetResources() OVERRIDE; | 24 virtual int64 GetResources() override; |
25 virtual void NotifyRequestResult(bool allowed) OVERRIDE; | 25 virtual void NotifyRequestResult(bool allowed) override; |
26 | 26 |
27 private: | 27 private: |
28 const GURL origin_; | 28 const GURL origin_; |
29 int64 resources_; | 29 int64 resources_; |
30 const base::Callback<void(bool)> callback_; | 30 const base::Callback<void(bool)> callback_; |
31 | 31 |
32 DISALLOW_COPY_AND_ASSIGN(SimplePermissionRequest); | 32 DISALLOW_COPY_AND_ASSIGN(SimplePermissionRequest); |
33 }; | 33 }; |
34 | 34 |
35 } // namespace android_webview | 35 } // namespace android_webview |
36 | 36 |
37 #endif // ANDROID_WEBVIEW_NATIVE_PERMISSION_PROTECTED_MEDIA_ID_PERMISSION_REQUE
ST_H | 37 #endif // ANDROID_WEBVIEW_NATIVE_PERMISSION_PROTECTED_MEDIA_ID_PERMISSION_REQUE
ST_H |
OLD | NEW |