OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
11 #include "mojo/public/cpp/bindings/interface_request.h" | 11 #include "mojo/public/cpp/bindings/interface_request.h" |
12 | 12 |
13 namespace permissions { | 13 namespace blink { |
14 namespace mojom { | 14 namespace mojom { |
15 class PermissionService; | 15 class PermissionService; |
16 } | 16 } |
17 } | 17 } |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class PermissionServiceImpl; | 21 class PermissionServiceImpl; |
22 class RenderFrameHost; | 22 class RenderFrameHost; |
23 class RenderProcessHost; | 23 class RenderProcessHost; |
24 | 24 |
25 // Provides information to a PermissionService. It is used by the | 25 // Provides information to a PermissionService. It is used by the |
26 // PermissionServiceImpl to handle request permission UI. | 26 // PermissionServiceImpl to handle request permission UI. |
27 // There is one PermissionServiceContext per RenderFrameHost/RenderProcessHost | 27 // There is one PermissionServiceContext per RenderFrameHost/RenderProcessHost |
28 // which owns it. It then owns all PermissionServiceImpl associated to their | 28 // which owns it. It then owns all PermissionServiceImpl associated to their |
29 // owner. | 29 // owner. |
30 class PermissionServiceContext : public WebContentsObserver { | 30 class PermissionServiceContext : public WebContentsObserver { |
31 public: | 31 public: |
32 explicit PermissionServiceContext(RenderFrameHost* render_frame_host); | 32 explicit PermissionServiceContext(RenderFrameHost* render_frame_host); |
33 explicit PermissionServiceContext(RenderProcessHost* render_process_host); | 33 explicit PermissionServiceContext(RenderProcessHost* render_process_host); |
34 ~PermissionServiceContext() override; | 34 ~PermissionServiceContext() override; |
35 | 35 |
36 void CreateService( | 36 void CreateService( |
37 mojo::InterfaceRequest<permissions::mojom::PermissionService> request); | 37 mojo::InterfaceRequest<blink::mojom::PermissionService> request); |
38 | 38 |
39 // Called by a PermissionServiceImpl identified as |service| when it has a | 39 // Called by a PermissionServiceImpl identified as |service| when it has a |
40 // connection error in order to get unregistered and killed. | 40 // connection error in order to get unregistered and killed. |
41 void ServiceHadConnectionError(PermissionServiceImpl* service); | 41 void ServiceHadConnectionError(PermissionServiceImpl* service); |
42 | 42 |
43 BrowserContext* GetBrowserContext() const; | 43 BrowserContext* GetBrowserContext() const; |
44 GURL GetEmbeddingOrigin() const; | 44 GURL GetEmbeddingOrigin() const; |
45 | 45 |
46 RenderFrameHost* render_frame_host() const; | 46 RenderFrameHost* render_frame_host() const; |
47 | 47 |
(...skipping 11 matching lines...) Expand all Loading... |
59 RenderFrameHost* render_frame_host_; | 59 RenderFrameHost* render_frame_host_; |
60 RenderProcessHost* render_process_host_; | 60 RenderProcessHost* render_process_host_; |
61 ScopedVector<PermissionServiceImpl> services_; | 61 ScopedVector<PermissionServiceImpl> services_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(PermissionServiceContext); | 63 DISALLOW_COPY_AND_ASSIGN(PermissionServiceContext); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace content | 66 } // namespace content |
67 | 67 |
68 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ | 68 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
OLD | NEW |