aw_permission_request_delegate.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_PERMISSION_AW_PERMISSION_REQUEST_DELEGATE_H_
  5. #define ANDROID_WEBVIEW_BROWSER_PERMISSION_AW_PERMISSION_REQUEST_DELEGATE_H_
  6. #include <stdint.h>
  7. #include "url/gurl.h"
  8. namespace android_webview {
  9. // The delegate interface to be implemented for a specific permission request.
  10. class AwPermissionRequestDelegate {
  11. public:
  12. AwPermissionRequestDelegate();
  13. AwPermissionRequestDelegate(const AwPermissionRequestDelegate&) = delete;
  14. AwPermissionRequestDelegate& operator=(const AwPermissionRequestDelegate&) =
  15. delete;
  16. virtual ~AwPermissionRequestDelegate();
  17. // Get the origin which initiated the permission request.
  18. virtual const GURL& GetOrigin() = 0;
  19. // Get the resources the origin wanted to access.
  20. virtual int64_t GetResources() = 0;
  21. // Notify the permission request is allowed or not.
  22. virtual void NotifyRequestResult(bool allowed) = 0;
  23. };
  24. } // namespace android_webview
  25. #endif // ANDROID_WEBVIEW_BROWSER_PERMISSION_AW_PERMISSION_REQUEST_DELEGATE_H_