aw_browser_permission_request_delegate.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef ANDROID_WEBVIEW_BROWSER_AW_BROWSER_PERMISSION_REQUEST_DELEGATE_H_
  5. #define ANDROID_WEBVIEW_BROWSER_AW_BROWSER_PERMISSION_REQUEST_DELEGATE_H_
  6. #include "android_webview/browser/permission/permission_callback.h"
  7. #include "base/callback_forward.h"
  8. #include "url/gurl.h"
  9. namespace android_webview {
  10. // Delegate interface to handle the permission requests from |BrowserContext|.
  11. class AwBrowserPermissionRequestDelegate {
  12. public:
  13. // Returns the AwBrowserPermissionRequestDelegate instance associated with
  14. // the given render_process_id and render_frame_id, or NULL.
  15. static AwBrowserPermissionRequestDelegate* FromID(int render_process_id,
  16. int render_frame_id);
  17. virtual void RequestProtectedMediaIdentifierPermission(
  18. const GURL& origin,
  19. PermissionCallback callback) = 0;
  20. virtual void CancelProtectedMediaIdentifierPermissionRequests(
  21. const GURL& origin) = 0;
  22. virtual void RequestGeolocationPermission(const GURL& origin,
  23. PermissionCallback callback) = 0;
  24. virtual void CancelGeolocationPermissionRequests(const GURL& origin) = 0;
  25. virtual void RequestMIDISysexPermission(const GURL& origin,
  26. PermissionCallback callback) = 0;
  27. virtual void CancelMIDISysexPermissionRequests(const GURL& origin) = 0;
  28. protected:
  29. AwBrowserPermissionRequestDelegate() {}
  30. };
  31. } // namespace android_webview
  32. #endif // ANDROID_WEBVIEW_BROWSER_AW_BROWSER_PERMISSION_REQUEST_DELEGATE_H_