OLD | NEW |
(Empty) | |
| 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 CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" |
| 10 #include "content/public/browser/web_contents_observer.h" |
| 11 #include "mojo/public/cpp/bindings/interface_request.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class PermissionService; |
| 16 class PermissionServiceImpl; |
| 17 class RenderFrameHost; |
| 18 |
| 19 // Provides information to a PermissionService. It is used by the |
| 20 // PermissionService to handle request permission UI. |
| 21 // The RenderFrameHost creates an instance when setting up the Permission mojo |
| 22 // service and then passes ownership to the service. |
| 23 class PermissionServiceContext : public WebContentsObserver { |
| 24 public: |
| 25 void CreateService(mojo::InterfaceRequest<PermissionService> request); |
| 26 |
| 27 void ServiceHadConnectionError(PermissionServiceImpl* service); |
| 28 |
| 29 public: |
| 30 explicit PermissionServiceContext(RenderFrameHost* render_frame_host); |
| 31 virtual ~PermissionServiceContext(); |
| 32 |
| 33 // WebContentsObserver |
| 34 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| 35 void DidNavigateAnyFrame(RenderFrameHost* render_frame_host, |
| 36 const LoadCommittedDetails& details, |
| 37 const FrameNavigateParams& params) override; |
| 38 |
| 39 private: |
| 40 void CancelPendingRequests(RenderFrameHost*) const; |
| 41 |
| 42 RenderFrameHost* render_frame_host_; |
| 43 ScopedVector<PermissionServiceImpl> services_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(PermissionServiceContext); |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
OLD | NEW |