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 blink { |
| 14 namespace mojom { |
| 15 class PermissionService; |
| 16 } |
| 17 } |
| 18 |
13 namespace content { | 19 namespace content { |
14 | 20 |
15 class PermissionService; | |
16 class PermissionServiceImpl; | 21 class PermissionServiceImpl; |
17 class RenderFrameHost; | 22 class RenderFrameHost; |
18 class RenderProcessHost; | 23 class RenderProcessHost; |
19 | 24 |
20 // Provides information to a PermissionService. It is used by the | 25 // Provides information to a PermissionService. It is used by the |
21 // PermissionService to handle request permission UI. | 26 // PermissionService to handle request permission UI. |
22 // There is one PermissionServiceContext per RenderFrameHost/RenderProcessHost | 27 // There is one PermissionServiceContext per RenderFrameHost/RenderProcessHost |
23 // which owns it. It then owns all PermissionService associated to their owner. | 28 // which owns it. It then owns all PermissionService associated to their owner. |
24 class PermissionServiceContext : public WebContentsObserver { | 29 class PermissionServiceContext : public WebContentsObserver { |
25 public: | 30 public: |
26 explicit PermissionServiceContext(RenderFrameHost* render_frame_host); | 31 explicit PermissionServiceContext(RenderFrameHost* render_frame_host); |
27 explicit PermissionServiceContext(RenderProcessHost* render_process_host); | 32 explicit PermissionServiceContext(RenderProcessHost* render_process_host); |
28 ~PermissionServiceContext() override; | 33 ~PermissionServiceContext() override; |
29 | 34 |
30 void CreateService(mojo::InterfaceRequest<PermissionService> request); | 35 void CreateService( |
| 36 mojo::InterfaceRequest<blink::mojom::PermissionService> request); |
31 | 37 |
32 // Called by a PermissionService identified as |service| when it has a | 38 // Called by a PermissionService identified as |service| when it has a |
33 // connection error in order to get unregistered and killed. | 39 // connection error in order to get unregistered and killed. |
34 void ServiceHadConnectionError(PermissionServiceImpl* service); | 40 void ServiceHadConnectionError(PermissionServiceImpl* service); |
35 | 41 |
36 BrowserContext* GetBrowserContext() const; | 42 BrowserContext* GetBrowserContext() const; |
37 GURL GetEmbeddingOrigin() const; | 43 GURL GetEmbeddingOrigin() const; |
38 | 44 |
39 RenderFrameHost* render_frame_host() const; | 45 RenderFrameHost* render_frame_host() const; |
40 | 46 |
(...skipping 11 matching lines...) Loading... |
52 RenderFrameHost* render_frame_host_; | 58 RenderFrameHost* render_frame_host_; |
53 RenderProcessHost* render_process_host_; | 59 RenderProcessHost* render_process_host_; |
54 ScopedVector<PermissionServiceImpl> services_; | 60 ScopedVector<PermissionServiceImpl> services_; |
55 | 61 |
56 DISALLOW_COPY_AND_ASSIGN(PermissionServiceContext); | 62 DISALLOW_COPY_AND_ASSIGN(PermissionServiceContext); |
57 }; | 63 }; |
58 | 64 |
59 } // namespace content | 65 } // namespace content |
60 | 66 |
61 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ | 67 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_CONTEXT_H_ |
OLD | NEW |