Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / permissions / permission_context.h
blob7dfd84edbac55f7bc66889b4c728e3cccbae7097
1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_
8 #include <list>
10 #include "base/macros.h"
11 #include "components/content_settings/core/common/content_settings_types.h"
13 class PermissionContextBase;
14 class Profile;
15 class KeyedServiceBaseFactory;
17 namespace content {
18 enum class PermissionType;
19 }; // namespace content
21 class PermissionContext {
22 public:
23 // Helper method returning the PermissionContextBase object associated with
24 // the given ContentSettingsType.
25 // This can return nullptr if the the permission type has no associated
26 // context.
27 static PermissionContextBase* Get(
28 Profile* profile,
29 content::PermissionType content_settings_type);
31 // Return all the factories related to PermissionContext. These are the
32 // factories used by ::Get() to create a PermissionContextBase.
33 // This is meant to be used by callers of ::Get() that need to depend on these
34 // factories.
35 static const std::list<KeyedServiceBaseFactory*>& GetFactories();
37 private:
38 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionContext);
41 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_H_