| Index: android_webview/native/permission/permission_request_handler.h
|
| diff --git a/android_webview/native/permission/permission_request_handler.h b/android_webview/native/permission/permission_request_handler.h
|
| index 3acb497654edca30f9396b8cd1e79663f6b4a367..69a9171169dbea13262c166a826a52795990226a 100644
|
| --- a/android_webview/native/permission/permission_request_handler.h
|
| +++ b/android_webview/native/permission/permission_request_handler.h
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "content/public/browser/web_contents_observer.h"
|
| #include "url/gurl.h"
|
|
|
| namespace android_webview {
|
| @@ -22,9 +23,10 @@ class PermissionRequestHandlerClient;
|
| // requests.
|
| // It is owned by AwContents and has 1x1 mapping to AwContents. All methods
|
| // are running on UI thread.
|
| -class PermissionRequestHandler {
|
| +class PermissionRequestHandler : public content::WebContentsObserver {
|
| public:
|
| - PermissionRequestHandler(PermissionRequestHandlerClient* aw_contents);
|
| + PermissionRequestHandler(PermissionRequestHandlerClient* client,
|
| + content::WebContents* aw_contents);
|
| virtual ~PermissionRequestHandler();
|
|
|
| // Send the given |request| to PermissionRequestHandlerClient.
|
| @@ -36,6 +38,10 @@ class PermissionRequestHandler {
|
| // Allow |origin| to access the |resources|.
|
| void PreauthorizePermission(const GURL& origin, int64 resources);
|
|
|
| + // WebContentsObserver
|
| + virtual void NavigationEntryCommitted(
|
| + const content::LoadCommittedDetails& load_details) OVERRIDE;
|
| +
|
| private:
|
| friend class TestPermissionRequestHandler;
|
|
|
| @@ -48,6 +54,8 @@ class PermissionRequestHandler {
|
| // Cancel the given request.
|
| void CancelRequest(RequestIterator i);
|
|
|
| + void CancelAllRequests();
|
| +
|
| // Remove the invalid requests from requests_.
|
| void PruneRequests();
|
|
|
| @@ -61,6 +69,10 @@ class PermissionRequestHandler {
|
|
|
| std::map<std::string, int64> preauthorized_permission_;
|
|
|
| + // The unique id of the active NavigationEntry of the WebContents that we were
|
| + // opened for. Used to help expire on requests.
|
| + int contents_unique_id_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PermissionRequestHandler);
|
| };
|
|
|
|
|