| 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "content/browser/permissions/permission_service_context.h" | 11 #include "content/browser/permissions/permission_service_context.h" |
| 12 #include "content/common/permission_service.mojom.h" | 12 #include "content/common/permission_service.mojom.h" |
| 13 #include "content/public/browser/permission_type.h" | |
| 14 | 13 |
| 15 namespace content { | 14 namespace content { |
| 16 | 15 |
| 16 enum class PermissionType; |
| 17 |
| 17 // Implements the PermissionService Mojo interface. | 18 // Implements the PermissionService Mojo interface. |
| 18 // This service can be created from a RenderFrameHost or a RenderProcessHost. | 19 // This service can be created from a RenderFrameHost or a RenderProcessHost. |
| 19 // It is owned by a PermissionServiceContext. | 20 // It is owned by a PermissionServiceContext. |
| 20 // It receives at PermissionServiceContext instance when created which allows it | 21 // It receives at PermissionServiceContext instance when created which allows it |
| 21 // to have some information about the current context. That enables the service | 22 // to have some information about the current context. That enables the service |
| 22 // to know whether it can show UI and have knowledge of the associated | 23 // to know whether it can show UI and have knowledge of the associated |
| 23 // WebContents for example. | 24 // WebContents for example. |
| 24 class PermissionServiceImpl : public mojo::InterfaceImpl<PermissionService> { | 25 class PermissionServiceImpl : public mojo::InterfaceImpl<PermissionService> { |
| 25 public: | 26 public: |
| 26 ~PermissionServiceImpl() override; | 27 ~PermissionServiceImpl() override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // context_ owns |this|. | 74 // context_ owns |this|. |
| 74 PermissionServiceContext* context_; | 75 PermissionServiceContext* context_; |
| 75 base::WeakPtrFactory<PermissionServiceImpl> weak_factory_; | 76 base::WeakPtrFactory<PermissionServiceImpl> weak_factory_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(PermissionServiceImpl); | 78 DISALLOW_COPY_AND_ASSIGN(PermissionServiceImpl); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace content | 81 } // namespace content |
| 81 | 82 |
| 82 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ | 83 #endif // CONTENT_BROWSER_PERMISSIONS_PERMISSION_SERVICE_IMPL_H_ |
| OLD | NEW |