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